Skip to content

Commit e50b20f

Browse files
committed
fix doc
1 parent a5c24f2 commit e50b20f

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

doc/en-us/config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Array<string>
301301
* ``"miss-sep-in-table"``
302302
* ``"miss-space-between"``
303303
* ``"miss-symbol"``
304+
* ``"missing-fields"``
304305
* ``"missing-global-doc"``
305306
* ``"missing-local-export-doc"``
306307
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
511512
*/
512513
"type-check": "Fallback",
513514
/*
515+
* missing-fields
514516
* missing-parameter
515517
* missing-return
516518
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
638640
*/
639641
"type-check": "Fallback",
640642
/*
643+
* missing-fields
641644
* missing-parameter
642645
* missing-return
643646
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
831834
Enable lowercase global variable definition diagnostics.
832835
*/
833836
"lowercase-global": "Any",
837+
"missing-fields": "Any",
834838
/*
835839
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
836840
*/
@@ -1099,6 +1103,7 @@ object<string, string>
10991103
Enable lowercase global variable definition diagnostics.
11001104
*/
11011105
"lowercase-global": "Information",
1106+
"missing-fields": "Warning",
11021107
/*
11031108
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
11041109
*/
@@ -1676,7 +1681,7 @@ Set name style config
16761681
## type
16771682

16781683
```ts
1679-
Object<string, table: 0000029B6DB8EAE0>
1684+
Object<string, string | array>
16801685
```
16811686

16821687
## default

doc/pt-br/config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Array<string>
301301
* ``"miss-sep-in-table"``
302302
* ``"miss-space-between"``
303303
* ``"miss-symbol"``
304+
* ``"missing-fields"``
304305
* ``"missing-global-doc"``
305306
* ``"missing-local-export-doc"``
306307
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
511512
*/
512513
"type-check": "Fallback",
513514
/*
515+
* missing-fields
514516
* missing-parameter
515517
* missing-return
516518
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
638640
*/
639641
"type-check": "Fallback",
640642
/*
643+
* missing-fields
641644
* missing-parameter
642645
* missing-return
643646
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
831834
首字母小写的全局变量定义
832835
*/
833836
"lowercase-global": "Any",
837+
"missing-fields": "Any",
834838
/*
835839
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
836840
*/
@@ -1099,6 +1103,7 @@ object<string, string>
10991103
首字母小写的全局变量定义
11001104
*/
11011105
"lowercase-global": "Information",
1106+
"missing-fields": "Warning",
11021107
/*
11031108
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
11041109
*/
@@ -1676,7 +1681,7 @@ Set name style config
16761681
## type
16771682

16781683
```ts
1679-
Object<string, table: 0000029B6DB8EAE0>
1684+
Object<string, string | array>
16801685
```
16811686

16821687
## default

doc/zh-cn/config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Array<string>
301301
* ``"miss-sep-in-table"``
302302
* ``"miss-space-between"``
303303
* ``"miss-symbol"``
304+
* ``"missing-fields"``
304305
* ``"missing-global-doc"``
305306
* ``"missing-local-export-doc"``
306307
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
511512
*/
512513
"type-check": "Fallback",
513514
/*
515+
* missing-fields
514516
* missing-parameter
515517
* missing-return
516518
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
638640
*/
639641
"type-check": "Fallback",
640642
/*
643+
* missing-fields
641644
* missing-parameter
642645
* missing-return
643646
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
831834
首字母小写的全局变量定义
832835
*/
833836
"lowercase-global": "Any",
837+
"missing-fields": "Any",
834838
/*
835839
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
836840
*/
@@ -1098,6 +1102,7 @@ object<string, string>
10981102
首字母小写的全局变量定义
10991103
*/
11001104
"lowercase-global": "Information",
1105+
"missing-fields": "Warning",
11011106
/*
11021107
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
11031108
*/
@@ -1675,7 +1680,7 @@ Array<string>
16751680
## type
16761681

16771682
```ts
1678-
Object<string, table: 0000029B6DB8EAE0>
1683+
Object<string, string | array>
16791684
```
16801685

16811686
## default

doc/zh-tw/config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Array<string>
301301
* ``"miss-sep-in-table"``
302302
* ``"miss-space-between"``
303303
* ``"miss-symbol"``
304+
* ``"missing-fields"``
304305
* ``"missing-global-doc"``
305306
* ``"missing-local-export-doc"``
306307
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
511512
*/
512513
"type-check": "Fallback",
513514
/*
515+
* missing-fields
514516
* missing-parameter
515517
* missing-return
516518
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
638640
*/
639641
"type-check": "Fallback",
640642
/*
643+
* missing-fields
641644
* missing-parameter
642645
* missing-return
643646
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
831834
首字母小寫的全域變數定義
832835
*/
833836
"lowercase-global": "Any",
837+
"missing-fields": "Any",
834838
/*
835839
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
836840
*/
@@ -1098,6 +1102,7 @@ object<string, string>
10981102
首字母小寫的全域變數定義
10991103
*/
11001104
"lowercase-global": "Information",
1105+
"missing-fields": "Warning",
11011106
/*
11021107
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
11031108
*/
@@ -1675,7 +1680,7 @@ Set name style config
16751680
## type
16761681

16771682
```ts
1678-
Object<string, table: 0000029B6DB8EAE0>
1683+
Object<string, string | array>
16791684
```
16801685

16811686
## default

tools/build-doc.lua

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,37 @@ local function getDesc(lang, desc)
5353
return locale[id]
5454
end
5555

56-
local function buildType(md, lang, conf)
57-
md:add('md', '## type')
56+
local function view(conf)
5857
if type(conf.type) == 'table' then
59-
md:add('ts', ('%s | %s'):format(conf.type[1], conf.type[2]))
58+
local subViews = {}
59+
for i = 1, #conf.type do
60+
subViews[i] = conf.type[i]
61+
end
62+
return table.concat(subViews, ' | ')
6063
elseif conf.type == 'array' then
61-
md:add('ts', ('Array<%s>'):format(conf.items.type))
64+
return ('Array<%s>'):format(view(conf.items))
6265
elseif conf.type == 'object' then
6366
if conf.properties then
6467
local _, first = next(conf.properties)
6568
assert(first)
66-
md:add('ts', ('object<string, %s>'):format(first.type))
69+
return ('object<string, %s>'):format(view(first))
6770
elseif conf.patternProperties then
6871
local _, first = next(conf.patternProperties)
6972
assert(first)
70-
md:add('ts', ('Object<string, %s>'):format(first.type))
73+
return ('Object<string, %s>'):format(view(first))
7174
else
72-
md:add('ts', '**Unknown object type!!**')
75+
return '**Unknown object type!!**'
7376
end
7477
else
75-
md:add('ts', ('%s'):format(conf.type))
78+
return tostring(conf.type)
7679
end
7780
end
7881

82+
local function buildType(md, lang, conf)
83+
md:add('md', '## type')
84+
md:add('ts', view(conf))
85+
end
86+
7987
local function buildDesc(md, lang, conf)
8088
local desc = conf.markdownDescription or conf.description
8189
desc = getDesc(lang, desc)

0 commit comments

Comments
 (0)