summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/en-us/config.md7
-rw-r--r--doc/pt-br/config.md7
-rw-r--r--doc/zh-cn/config.md7
-rw-r--r--doc/zh-tw/config.md7
-rw-r--r--tools/build-doc.lua24
5 files changed, 40 insertions, 12 deletions
diff --git a/doc/en-us/config.md b/doc/en-us/config.md
index 84a3e9d6..96813af1 100644
--- a/doc/en-us/config.md
+++ b/doc/en-us/config.md
@@ -301,6 +301,7 @@ Array<string>
* ``"miss-sep-in-table"``
* ``"miss-space-between"``
* ``"miss-symbol"``
+* ``"missing-fields"``
* ``"missing-global-doc"``
* ``"missing-local-export-doc"``
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
Enable lowercase global variable definition diagnostics.
*/
"lowercase-global": "Any",
+ "missing-fields": "Any",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1099,6 +1103,7 @@ object<string, string>
Enable lowercase global variable definition diagnostics.
*/
"lowercase-global": "Information",
+ "missing-fields": "Warning",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1676,7 +1681,7 @@ Set name style config
## type
```ts
-Object<string, table: 0000029B6DB8EAE0>
+Object<string, string | array>
```
## default
diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md
index de932f6a..d18552ad 100644
--- a/doc/pt-br/config.md
+++ b/doc/pt-br/config.md
@@ -301,6 +301,7 @@ Array<string>
* ``"miss-sep-in-table"``
* ``"miss-space-between"``
* ``"miss-symbol"``
+* ``"missing-fields"``
* ``"missing-global-doc"``
* ``"missing-local-export-doc"``
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
首字母小写的全局变量定义
*/
"lowercase-global": "Any",
+ "missing-fields": "Any",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1099,6 +1103,7 @@ object<string, string>
首字母小写的全局变量定义
*/
"lowercase-global": "Information",
+ "missing-fields": "Warning",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1676,7 +1681,7 @@ Set name style config
## type
```ts
-Object<string, table: 0000029B6DB8EAE0>
+Object<string, string | array>
```
## default
diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md
index 54caf6c7..692b5a91 100644
--- a/doc/zh-cn/config.md
+++ b/doc/zh-cn/config.md
@@ -301,6 +301,7 @@ Array<string>
* ``"miss-sep-in-table"``
* ``"miss-space-between"``
* ``"miss-symbol"``
+* ``"missing-fields"``
* ``"missing-global-doc"``
* ``"missing-local-export-doc"``
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
首字母小写的全局变量定义
*/
"lowercase-global": "Any",
+ "missing-fields": "Any",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1098,6 +1102,7 @@ object<string, string>
首字母小写的全局变量定义
*/
"lowercase-global": "Information",
+ "missing-fields": "Warning",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1675,7 +1680,7 @@ Array<string>
## type
```ts
-Object<string, table: 0000029B6DB8EAE0>
+Object<string, string | array>
```
## default
diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md
index c2c49c69..daadb558 100644
--- a/doc/zh-tw/config.md
+++ b/doc/zh-tw/config.md
@@ -301,6 +301,7 @@ Array<string>
* ``"miss-sep-in-table"``
* ``"miss-space-between"``
* ``"miss-symbol"``
+* ``"missing-fields"``
* ``"missing-global-doc"``
* ``"missing-local-export-doc"``
* ``"missing-parameter"``
@@ -511,6 +512,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -638,6 +640,7 @@ object<string, string>
*/
"type-check": "Fallback",
/*
+ * missing-fields
* missing-parameter
* missing-return
* missing-return-value
@@ -831,6 +834,7 @@ object<string, string>
首字母小寫的全域變數定義
*/
"lowercase-global": "Any",
+ "missing-fields": "Any",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1098,6 +1102,7 @@ object<string, string>
首字母小寫的全域變數定義
*/
"lowercase-global": "Information",
+ "missing-fields": "Warning",
/*
Missing annotations for globals! Global functions must have a comment and annotations for all parameters and return values.
*/
@@ -1675,7 +1680,7 @@ Set name style config
## type
```ts
-Object<string, table: 0000029B6DB8EAE0>
+Object<string, string | array>
```
## default
diff --git a/tools/build-doc.lua b/tools/build-doc.lua
index fbf5fa6b..783a5311 100644
--- a/tools/build-doc.lua
+++ b/tools/build-doc.lua
@@ -53,29 +53,37 @@ local function getDesc(lang, desc)
return locale[id]
end
-local function buildType(md, lang, conf)
- md:add('md', '## type')
+local function view(conf)
if type(conf.type) == 'table' then
- md:add('ts', ('%s | %s'):format(conf.type[1], conf.type[2]))
+ local subViews = {}
+ for i = 1, #conf.type do
+ subViews[i] = conf.type[i]
+ end
+ return table.concat(subViews, ' | ')
elseif conf.type == 'array' then
- md:add('ts', ('Array<%s>'):format(conf.items.type))
+ return ('Array<%s>'):format(view(conf.items))
elseif conf.type == 'object' then
if conf.properties then
local _, first = next(conf.properties)
assert(first)
- md:add('ts', ('object<string, %s>'):format(first.type))
+ return ('object<string, %s>'):format(view(first))
elseif conf.patternProperties then
local _, first = next(conf.patternProperties)
assert(first)
- md:add('ts', ('Object<string, %s>'):format(first.type))
+ return ('Object<string, %s>'):format(view(first))
else
- md:add('ts', '**Unknown object type!!**')
+ return '**Unknown object type!!**'
end
else
- md:add('ts', ('%s'):format(conf.type))
+ return tostring(conf.type)
end
end
+local function buildType(md, lang, conf)
+ md:add('md', '## type')
+ md:add('ts', view(conf))
+end
+
local function buildDesc(md, lang, conf)
local desc = conf.markdownDescription or conf.description
desc = getDesc(lang, desc)