wikilint 2.46.4 → 2.47.0
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 +14 -6
- package/dist/bin/config.js +1 -1
- package/dist/lib/text.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div align="center"><img src="https://github.com/bhsd-harry/wikiparser-node/raw/main/logo.png" width="200" alt="WikiParser-Node logo"></div
|
|
1
|
+
<div align="center"><img src="https://github.com/bhsd-harry/wikiparser-node/raw/main/logo.png" width="200" alt="WikiParser-Node logo"></div><!-- markdownlint-disable-line line-length -->
|
|
2
2
|
|
|
3
3
|
# WikiLint
|
|
4
4
|
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|

|
|
10
10
|
[](https://www.bestpractices.dev/projects/13661)
|
|
11
11
|
|
|
12
|
-
This is a minimal version of [WikiParser-Node](https://www.npmjs.com/package/wikiparser-node).
|
|
12
|
+
This is a minimal version of [WikiParser-Node](https://www.npmjs.com/package/wikiparser-node).
|
|
13
|
+
The [Wikitext LSP](https://www.npmjs.com/package/wikitext-lsp) and the
|
|
14
|
+
[WikiParser Language Server](https://marketplace.visualstudio.com/items?itemName=Bhsd.vscode-extension-wikiparser)
|
|
15
|
+
VS Code extension is written based on this package.
|
|
13
16
|
|
|
14
17
|
You can also directly lint Wikitext articles in the command line using this package:
|
|
15
18
|
|
|
@@ -61,7 +64,10 @@ npm i mathoid-texvcjs vscode-css-languageservice
|
|
|
61
64
|
|
|
62
65
|
## Configuration
|
|
63
66
|
|
|
64
|
-
For MediaWiki sites with the [CodeMirror extension](https://mediawiki.org/wiki/Extension:CodeMirror)
|
|
67
|
+
For MediaWiki sites with the [CodeMirror extension](https://mediawiki.org/wiki/Extension:CodeMirror)
|
|
68
|
+
installed, such as different language editions of Wikipedia and other
|
|
69
|
+
[Wikimedia Foundation-hosted sites](https://meta.wikimedia.org/wiki/Special:SiteMatrix),
|
|
70
|
+
you can use the following command to obtain the parser configuration:
|
|
65
71
|
|
|
66
72
|
```sh
|
|
67
73
|
npx getParserConfig <site> <script path> [user] [force]
|
|
@@ -69,7 +75,8 @@ npx getParserConfig <site> <script path> [user] [force]
|
|
|
69
75
|
npx getParserConfig frwiki https://fr.wikipedia.org/w user@example.net
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
The generated configuration file will be saved in the `config` directory. You
|
|
78
|
+
The generated configuration file will be saved in the `config` directory. You
|
|
79
|
+
can then use the site name as the `--config` option.
|
|
73
80
|
|
|
74
81
|
```sh
|
|
75
82
|
# For example:
|
|
@@ -78,7 +85,8 @@ npx wikilint --config frwiki *.wiki
|
|
|
78
85
|
|
|
79
86
|
## Use with pre-commit
|
|
80
87
|
|
|
81
|
-
To use `wikilint` with [pre-commit](https://pre-commit.com/), add the following
|
|
88
|
+
To use `wikilint` with [pre-commit](https://pre-commit.com/), add the following
|
|
89
|
+
to your [`.pre-commit-config.yaml`](https://pre-commit.com/#adding-pre-commit-plugins-to-your-project):
|
|
82
90
|
|
|
83
91
|
```yaml
|
|
84
92
|
repos:
|
|
@@ -89,6 +97,6 @@ repos:
|
|
|
89
97
|
# You can add any CLI options as needed
|
|
90
98
|
entry: wikilint
|
|
91
99
|
language: node
|
|
92
|
-
additional_dependencies: ['wikilint@2.
|
|
100
|
+
additional_dependencies: ['wikilint@2.47.0']
|
|
93
101
|
files: \.(mediawiki|wiki|wikitext)$
|
|
94
102
|
```
|
package/dist/bin/config.js
CHANGED
|
@@ -41,7 +41,7 @@ const filterGadget = (id) => {
|
|
|
41
41
|
const n = Number(id);
|
|
42
42
|
return n < 2300 || n > 2303; // Gadget, Gadget talk, Gadget definition, Gadget definition talk
|
|
43
43
|
};
|
|
44
|
-
const pkg = 'wikilint', version = '2.
|
|
44
|
+
const pkg = 'wikilint', version = '2.47.0';
|
|
45
45
|
/**
|
|
46
46
|
* Get the parser configuration for a Wikimedia Foundation project.
|
|
47
47
|
* @param site site nickname
|
package/dist/lib/text.js
CHANGED
|
@@ -274,7 +274,7 @@ class AstText extends node_1.AstNode {
|
|
|
274
274
|
if (char === '<') {
|
|
275
275
|
e.suggestions = [(0, lint_1.fixByEscape)(startIndex, '<')];
|
|
276
276
|
}
|
|
277
|
-
else if (char === 'h' && type !== 'link-text' && wordRegex.test(previousChar
|
|
277
|
+
else if (char === 'h' && type !== 'link-text' && wordRegex.test(previousChar ?? '')) {
|
|
278
278
|
e.suggestions = [(0, lint_1.fixBySpace)(startIndex)];
|
|
279
279
|
}
|
|
280
280
|
else if (lbrackInExtLinkText) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikilint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
4
4
|
"description": "A Node.js linter for MediaWiki markup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -103,25 +103,25 @@
|
|
|
103
103
|
"@bhsd/stylelint-util": "^1.1.0",
|
|
104
104
|
"culori": "^4.0.2",
|
|
105
105
|
"entities": "^8.0.0",
|
|
106
|
-
"vscode-languageserver-types": "^3.18.
|
|
106
|
+
"vscode-languageserver-types": "^3.18.3"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@bhsd/code-standard": "^4.
|
|
109
|
+
"@bhsd/code-standard": "^4.2.0",
|
|
110
110
|
"@bhsd/nodejs": "^1.2.1",
|
|
111
|
-
"@bhsd/test-util": "^3.
|
|
111
|
+
"@bhsd/test-util": "^3.2.0",
|
|
112
112
|
"c8": "^12.0.0",
|
|
113
113
|
"diff2html-cli": "^5.2.15",
|
|
114
114
|
"esbuild": "^0.28.2",
|
|
115
|
-
"eslint": "^10.
|
|
115
|
+
"eslint": "^10.10.0",
|
|
116
116
|
"markdownlint-cli2": "^0.23.2",
|
|
117
117
|
"mathoid-texvcjs": "^0.6.0",
|
|
118
|
-
"stylelint": "^17.
|
|
118
|
+
"stylelint": "^17.15.0",
|
|
119
119
|
"typescript": "^6.0.3",
|
|
120
120
|
"v8r": "^6.1.0",
|
|
121
121
|
"vscode-css-languageservice": "^6.3.10",
|
|
122
122
|
"vscode-html-languageservice": "^5.6.2",
|
|
123
123
|
"vscode-json-languageservice": "^5.7.2",
|
|
124
|
-
"vscode-languageserver-textdocument": "^1.0.
|
|
124
|
+
"vscode-languageserver-textdocument": "^1.0.14"
|
|
125
125
|
},
|
|
126
126
|
"engines": {
|
|
127
127
|
"node": "^20.19.0 || ^22.13.0 || >=24.11.0"
|