wikilint 2.18.0 → 2.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/config.js +4 -2
- package/config/.schema.json +14 -1
- package/config/default.json +460 -4
- package/config/enwiki.json +111 -0
- package/config/jawiki.json +954 -0
- package/config/llwiki.json +117 -0
- package/config/minimum.json +3 -0
- package/config/moegirl.json +104 -0
- package/config/zhwiki.json +109 -0
- package/data/signatures.json +141 -353
- package/dist/base.d.mts +10 -1
- package/dist/base.d.ts +10 -1
- package/dist/bin/config.js +67 -39
- package/dist/index.js +7 -5
- package/dist/lib/document.d.ts +6 -6
- package/dist/lib/document.js +43 -36
- package/dist/lib/lsp.d.ts +20 -3
- package/dist/lib/lsp.js +267 -103
- package/dist/src/attribute.js +10 -4
- package/dist/src/index.js +3 -2
- package/dist/src/nowiki/doubleUnderscore.d.ts +1 -0
- package/dist/src/nowiki/doubleUnderscore.js +2 -0
- package/dist/src/transclude.js +20 -9
- package/dist/util/diff.js +1 -1
- package/dist/util/lint.js +32 -1
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ npx wikilint --config zhwiki --include --lang zh-hans *.wiki
|
|
|
34
34
|
|
|
35
35
|
## Configuration
|
|
36
36
|
|
|
37
|
-
For MediaWiki sites
|
|
37
|
+
For MediaWiki sites with the [CodeMirror extension](https://mediawiki.org/wiki/Extension:CodeMirror) installed, such as different language editions of Wikipedia and other [Wikimedia Foundation-hosted sites](https://meta.wikimedia.org/wiki/Special:SiteMatrix), you can use the following command to obtain the parser configuration:
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
40
|
npx getParserConfig <site> <script path> [force]
|
package/bin/config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
require('../dist/bin/config.js');
|
|
2
|
+
'use strict';
|
|
3
|
+
const /** @type {import('./config.ts').default} */ fetchConfig = require('../dist/bin/config.js').default;
|
|
4
|
+
const [,, site, url, force] = process.argv;
|
|
5
|
+
fetchConfig(site, url, force);
|
package/config/.schema.json
CHANGED
|
@@ -47,6 +47,18 @@
|
|
|
47
47
|
},
|
|
48
48
|
"additionalProperties": false
|
|
49
49
|
},
|
|
50
|
+
"functionHook": {
|
|
51
|
+
"description": "canonical magic words as parser functions",
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^[^#A-Z]+$"
|
|
56
|
+
},
|
|
57
|
+
"contains": {
|
|
58
|
+
"const": "msgnw"
|
|
59
|
+
},
|
|
60
|
+
"minItems": 1
|
|
61
|
+
},
|
|
50
62
|
"variable": {
|
|
51
63
|
"description": "canonical magic words as variables",
|
|
52
64
|
"type": "array",
|
|
@@ -189,7 +201,7 @@
|
|
|
189
201
|
"type": "array",
|
|
190
202
|
"items": {
|
|
191
203
|
"type": "string",
|
|
192
|
-
"pattern": "
|
|
204
|
+
"pattern": "^[##][^A-Z]+$"
|
|
193
205
|
}
|
|
194
206
|
},
|
|
195
207
|
"variants": {
|
|
@@ -237,6 +249,7 @@
|
|
|
237
249
|
"html",
|
|
238
250
|
"namespaces",
|
|
239
251
|
"nsid",
|
|
252
|
+
"functionHook",
|
|
240
253
|
"variable",
|
|
241
254
|
"parserFunction",
|
|
242
255
|
"doubleUnderscore",
|