wikilint 2.38.1 → 2.39.1
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 +6 -3
- package/config/.schema.json +1 -1
- package/config/minimum.json +3 -1
- package/dist/base.d.mts +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/bin/cli.js +48 -11
- package/dist/bin/config.js +1 -1
- package/dist/index.js +3 -2
- package/dist/lib/lsp.js +3 -1
- package/dist/lib/title.d.ts +2 -2
- package/dist/lib/title.js +4 -3
- package/dist/parser/hrAndDoubleUnderscore.js +1 -1
- package/dist/parser/table.js +1 -1
- package/dist/src/attribute.js +1 -1
- package/dist/src/link/base.d.ts +3 -2
- package/dist/src/link/base.js +2 -2
- package/dist/src/nowiki/doubleUnderscore.js +1 -1
- package/dist/util/string.js +1 -1
- package/package.json +15 -11
package/README.md
CHANGED
|
@@ -23,13 +23,16 @@ npx wikilint --config zhwiki --include --lang zh-hans *.wiki
|
|
|
23
23
|
| `-c`, `--config` | \<path or preset config\> | Choose parser's [configuration](https://github.com/bhsd-harry/wikiparser-node/wiki/Parser-%28EN%29#config) | `default` |
|
|
24
24
|
| `--cache` | | Enable caching | `false` |
|
|
25
25
|
| `--cache-file` | \<path\> | Specify cache file and enable caching | `.wikilintcache` |
|
|
26
|
-
| `--ext` | \<extension\> | Specify file extension<br>Can be used multiple times | all files |
|
|
26
|
+
| `-e`, `--ext` | \<extension\> | Specify file extension<br>Can be used multiple times | all files |
|
|
27
27
|
| `--fix` | | Automatically fix problems | `false` |
|
|
28
28
|
| `-h`, `--help` | | Print available options | |
|
|
29
29
|
| `-i`, `--include` | | Parse for inclusion | `false` |
|
|
30
|
+
| `--id`, `--ignore-disables` | | Ignore inline configuration comments | `false` |
|
|
30
31
|
| `--ignore` | \<pattern\> | Ignore files matching the glob pattern<br>Can be used multiple times | |
|
|
31
32
|
| `-l`, `--lang` | \<path or preset language\> | Choose [i18n](https://github.com/bhsd-harry/wikiparser-node/wiki/Parser-%28EN%29#i18n) language | English |
|
|
32
33
|
| `--lc`, `--lint-config` | \<path\> | Specify [lint config](https://github.com/bhsd-harry/wikiparser-node/wiki/Rules#configuration) file | `.wikilintrc.json`<br>`.wikilintrc.js`<br>`.wikilintrc.cjs`<br>`.wikilintrc.mjs` |
|
|
34
|
+
| `--nc`, `--no-color` | | Disable colored output | `false` |
|
|
35
|
+
| `--print-config`, `--print-lint-config` | | Print the resolved lint config and exit | |
|
|
33
36
|
| `-q`, `--quiet` | | Report errors only | errors and warnings |
|
|
34
37
|
| `-r`, `--recursive` | | Recursively lint files | `false` |
|
|
35
38
|
| `-s`, `--strict` | | Exit when there is an error or warning<br>Override `-q` or `--quiet` | Exit `1` only where there is an error |
|
|
@@ -42,12 +45,12 @@ For MediaWiki sites with the [CodeMirror extension](https://mediawiki.org/wiki/E
|
|
|
42
45
|
```sh
|
|
43
46
|
npx getParserConfig <site> <script path> [user] [force]
|
|
44
47
|
# For example:
|
|
45
|
-
npx getParserConfig
|
|
48
|
+
npx getParserConfig frwiki https://fr.wikipedia.org/w user@example.net
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
The generated configuration file will be saved in the `config` directory. You can then use the site name as the `--config` option.
|
|
49
52
|
|
|
50
53
|
```sh
|
|
51
54
|
# For example:
|
|
52
|
-
npx wikilint --config
|
|
55
|
+
npx wikilint --config frwiki *.wiki
|
|
53
56
|
```
|
package/config/.schema.json
CHANGED
package/config/minimum.json
CHANGED
|
@@ -199,7 +199,9 @@
|
|
|
199
199
|
],
|
|
200
200
|
"doubleUnderscore": [
|
|
201
201
|
[],
|
|
202
|
-
[]
|
|
202
|
+
[],
|
|
203
|
+
{},
|
|
204
|
+
{}
|
|
203
205
|
],
|
|
204
206
|
"protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",
|
|
205
207
|
"interwiki": [],
|
package/dist/base.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Config {
|
|
|
7
7
|
readonly variable: string[];
|
|
8
8
|
readonly functionHook: string[];
|
|
9
9
|
readonly parserFunction: [Record<string, string>, Record<string, string>, string[], string[]];
|
|
10
|
-
readonly doubleUnderscore: [string[], string[], Record<string, string
|
|
10
|
+
readonly doubleUnderscore: [string[], string[], Record<string, string>, Record<string, string>];
|
|
11
11
|
readonly protocol: string;
|
|
12
12
|
readonly interwiki: string[];
|
|
13
13
|
readonly img: Record<string, string>;
|
package/dist/base.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Config {
|
|
|
7
7
|
readonly variable: string[];
|
|
8
8
|
readonly functionHook: string[];
|
|
9
9
|
readonly parserFunction: [Record<string, string>, Record<string, string>, string[], string[]];
|
|
10
|
-
readonly doubleUnderscore: [string[], string[], Record<string, string
|
|
10
|
+
readonly doubleUnderscore: [string[], string[], Record<string, string>, Record<string, string>];
|
|
11
11
|
readonly protocol: string;
|
|
12
12
|
readonly interwiki: string[];
|
|
13
13
|
readonly img: Record<string, string>;
|
package/dist/bin/cli.js
CHANGED
|
@@ -14,13 +14,16 @@ Available options:
|
|
|
14
14
|
-c, --config <path or preset config> Choose parser's configuration
|
|
15
15
|
--cache Enable caching
|
|
16
16
|
--cache-file <path> Specify cache file
|
|
17
|
-
--ext <extension>
|
|
17
|
+
-e, --ext <extension> Specify file extension
|
|
18
18
|
--fix Automatically fix problems
|
|
19
19
|
-h, --help Print available options
|
|
20
20
|
-i, --include Parse for inclusion
|
|
21
|
+
--id, --ignore-disables Ignore inline configuration comments
|
|
21
22
|
--ignore <pattern> Ignore files that match the pattern
|
|
22
23
|
-l, --lang <path or preset language> Choose i18n language
|
|
23
24
|
--lc, --lint-config <path> Specify lint config file
|
|
25
|
+
--nc, --no-color Disable colored output
|
|
26
|
+
--print-config, --print-lint-config Print resolved lint config and exit
|
|
24
27
|
-q, --quiet Report errors only
|
|
25
28
|
-r, --recursive Lint files in directories recursively
|
|
26
29
|
-s, --strict Exit when there is an error or warning
|
|
@@ -28,8 +31,8 @@ Available options:
|
|
|
28
31
|
-v, --version Print package version
|
|
29
32
|
`, root = path_1.default.join(__dirname, '..', '..'), configPath = path_1.default.join(root, 'config'), preset = new Set(fs_1.default.readdirSync(configPath).filter(file => file.endsWith('.json'))
|
|
30
33
|
.map(file => file.slice(0, -5))), lintConfigDefaults = ['.wikilintrc.json', '.wikilintrc.js', '.wikilintrc.cjs', '.wikilintrc.mjs'], i18n = new Set(fs_1.default.readdirSync(path_1.default.join(root, 'i18n')).filter(file => file.endsWith('.json'))
|
|
31
|
-
.map(file => file.slice(0, -5))), { argv } = process, exts = [], ignorePatterns = [], jobs = [];
|
|
32
|
-
let files = [], lintConfigFile, cacheFile = '.wikilintcache', cache, exiting = false, fixing = false, include = false,
|
|
34
|
+
.map(file => file.slice(0, -5))), colorSet = new Set(['red', 'yellow']), { argv } = process, exts = [], ignorePatterns = [], jobs = [];
|
|
35
|
+
let files = [], lintConfigFile, cacheFile = '.wikilintcache', cache, caching = false, colors = true, exiting = false, fixing = false, include = false, ignoreDisables = false, printLintConfig = false, quiet = false, recursive = false, strict = false, nErr = 0, nWarn = 0, nFixableErr = 0, nFixableWarn = 0, option;
|
|
33
36
|
/**
|
|
34
37
|
* exit with message
|
|
35
38
|
* @param msg message
|
|
@@ -138,8 +141,17 @@ const throwOnCacheFile = (input) => {
|
|
|
138
141
|
* @param word item name
|
|
139
142
|
*/
|
|
140
143
|
const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
/**
|
|
145
|
+
* style text if possible
|
|
146
|
+
* @param format style format
|
|
147
|
+
* @param text text to style
|
|
148
|
+
*/
|
|
149
|
+
const styleText = (format, text) => {
|
|
150
|
+
if (!colors) {
|
|
151
|
+
format = (Array.isArray(format) ? format : [format]).filter(f => !colorSet.has(f));
|
|
152
|
+
}
|
|
153
|
+
return util_1.default.styleText(format, text);
|
|
154
|
+
};
|
|
143
155
|
/**
|
|
144
156
|
* color the severity
|
|
145
157
|
* @param severity problem severity
|
|
@@ -152,16 +164,13 @@ for (let i = 2; i < argv.length; i++) {
|
|
|
152
164
|
case '--config':
|
|
153
165
|
throwOnConfig(argv[++i]);
|
|
154
166
|
break;
|
|
155
|
-
case '--lc':
|
|
156
|
-
case '--lint-config':
|
|
157
|
-
throwOnLintConfig(argv[++i]);
|
|
158
|
-
break;
|
|
159
167
|
case '--cache':
|
|
160
168
|
caching = true;
|
|
161
169
|
break;
|
|
162
170
|
case '--cache-file':
|
|
163
171
|
throwOnCacheFile(argv[++i]);
|
|
164
172
|
break;
|
|
173
|
+
case '-e':
|
|
165
174
|
case '--ext':
|
|
166
175
|
throwOnExt(argv[++i]);
|
|
167
176
|
break;
|
|
@@ -177,6 +186,10 @@ for (let i = 2; i < argv.length; i++) {
|
|
|
177
186
|
case '--include':
|
|
178
187
|
include = true;
|
|
179
188
|
break;
|
|
189
|
+
case '--id':
|
|
190
|
+
case '--ignore-disables':
|
|
191
|
+
ignoreDisables = true;
|
|
192
|
+
break;
|
|
180
193
|
case '--ignore':
|
|
181
194
|
throwOnIgnore(argv[++i]);
|
|
182
195
|
break;
|
|
@@ -184,6 +197,18 @@ for (let i = 2; i < argv.length; i++) {
|
|
|
184
197
|
case '--lang':
|
|
185
198
|
throwOnLang(argv[++i]);
|
|
186
199
|
break;
|
|
200
|
+
case '--lc':
|
|
201
|
+
case '--lint-config':
|
|
202
|
+
throwOnLintConfig(argv[++i]);
|
|
203
|
+
break;
|
|
204
|
+
case '--nc':
|
|
205
|
+
case '--no-color':
|
|
206
|
+
colors = false;
|
|
207
|
+
break;
|
|
208
|
+
case '--print-config':
|
|
209
|
+
case '--print-lint-config':
|
|
210
|
+
printLintConfig = true;
|
|
211
|
+
break;
|
|
187
212
|
case '-q':
|
|
188
213
|
case '--quiet':
|
|
189
214
|
quiet = true;
|
|
@@ -223,6 +248,10 @@ for (let i = 2; i < argv.length; i++) {
|
|
|
223
248
|
case '--lang':
|
|
224
249
|
throwOnLang(value);
|
|
225
250
|
break;
|
|
251
|
+
case '--lc':
|
|
252
|
+
case '--lint-config':
|
|
253
|
+
throwOnLintConfig(value);
|
|
254
|
+
break;
|
|
226
255
|
default:
|
|
227
256
|
known = false;
|
|
228
257
|
}
|
|
@@ -307,8 +336,16 @@ const { mtimeMs } = fs_1.default.statSync(config), obj = cache?.[include ? 'incl
|
|
|
307
336
|
cur = path_1.default.dirname(cur);
|
|
308
337
|
}
|
|
309
338
|
}
|
|
310
|
-
index_1.default.lintConfig.computeEditInfo =
|
|
311
|
-
index_1.default.lintConfig.fix =
|
|
339
|
+
index_1.default.lintConfig.computeEditInfo = true;
|
|
340
|
+
index_1.default.lintConfig.fix = fixing;
|
|
341
|
+
index_1.default.lintConfig.ignoreDisables = ignoreDisables;
|
|
342
|
+
if (printLintConfig) {
|
|
343
|
+
console.log(util_1.default.inspect({
|
|
344
|
+
...index_1.default.lintConfig, // eslint-disable-line @typescript-eslint/no-misused-spread
|
|
345
|
+
rules: index_1.default.lintConfig.rules,
|
|
346
|
+
}, { depth: null, colors }));
|
|
347
|
+
process.exit(0);
|
|
348
|
+
}
|
|
312
349
|
for (const file of new Set(files.map(f => path_1.default.resolve(f)))) {
|
|
313
350
|
const stat = fs_1.default.statSync(file);
|
|
314
351
|
if (stat.isDirectory()) {
|
package/dist/bin/config.js
CHANGED
|
@@ -40,7 +40,7 @@ const filterGadget = (id) => {
|
|
|
40
40
|
const n = Number(id);
|
|
41
41
|
return n < 2300 || n > 2303; // Gadget, Gadget talk, Gadget definition, Gadget definition talk
|
|
42
42
|
};
|
|
43
|
-
const pkg = "wikilint", version = "2.
|
|
43
|
+
const pkg = "wikilint", version = "2.39.1";
|
|
44
44
|
/**
|
|
45
45
|
* Get the parser configuration for a Wikimedia Foundation project.
|
|
46
46
|
* @param site site nickname
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ const jsonRequire = (file) => {
|
|
|
26
26
|
if (fullPath.endsWith('.json')) {
|
|
27
27
|
return require(fullPath);
|
|
28
28
|
}
|
|
29
|
+
/* c8 ignore next */
|
|
29
30
|
throw new RangeError('Only JSON files are supported!');
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
@@ -107,7 +108,7 @@ const Parser = {
|
|
|
107
108
|
this.config = rootRequire(this.config, 'config');
|
|
108
109
|
}
|
|
109
110
|
/* c8 ignore next 3 */
|
|
110
|
-
if (
|
|
111
|
+
if (!('functionHook' in this.config)) {
|
|
111
112
|
(0, diff_1.error)(`The schema (${path_1.default.join(__dirname, '..', 'config', '.schema.json')}) of parser configuration is updated.`);
|
|
112
113
|
}
|
|
113
114
|
return this.getConfig();
|
|
@@ -115,7 +116,7 @@ const Parser = {
|
|
|
115
116
|
/* NOT FOR BROWSER ONLY END */
|
|
116
117
|
const parserConfig = config ?? this.config, { doubleUnderscore, ext, parserFunction, variable, } = parserConfig;
|
|
117
118
|
for (let i = 0; i < 2; i++) {
|
|
118
|
-
if (doubleUnderscore
|
|
119
|
+
if (doubleUnderscore[i].length === 0) {
|
|
119
120
|
doubleUnderscore[i] = Object.keys(doubleUnderscore[i + 2]);
|
|
120
121
|
}
|
|
121
122
|
}
|
package/dist/lib/lsp.js
CHANGED
|
@@ -254,6 +254,7 @@ const partialParse = async (wikitext, watch, include, config = index_1.default.g
|
|
|
254
254
|
set(parseOnce, 0);
|
|
255
255
|
}
|
|
256
256
|
else {
|
|
257
|
+
/* c8 ignore next */
|
|
257
258
|
resolve();
|
|
258
259
|
}
|
|
259
260
|
},
|
|
@@ -498,6 +499,7 @@ class LanguageService {
|
|
|
498
499
|
colors = new RegExp(String.raw `\b${Object.keys(colorName).join('|')}\b`, 'giu');
|
|
499
500
|
}
|
|
500
501
|
catch {
|
|
502
|
+
/* c8 ignore next */
|
|
501
503
|
colors = false;
|
|
502
504
|
}
|
|
503
505
|
}
|
|
@@ -609,7 +611,7 @@ class LanguageService {
|
|
|
609
611
|
* @param position position / 位置
|
|
610
612
|
*/
|
|
611
613
|
async provideCompletionItems(text, position) {
|
|
612
|
-
const { re, allTags, functions, switches, jaSwitches, protocols, params, tags, ext, } = this.#prepareCompletionConfig(), { line, character } = position, curLine = text.split(/\r?\n/u, line + 1)[line], mt = re.exec(curLine?.slice(0, character) ?? ''), [, , iAlias
|
|
614
|
+
const { re, allTags, functions, switches, jaSwitches, protocols, params, tags, ext, } = this.#prepareCompletionConfig(), { line, character } = position, curLine = text.split(/\r?\n/u, line + 1)[line], mt = re.exec(curLine?.slice(0, character) ?? ''), [, , iAlias, sAlias] = this.config.doubleUnderscore;
|
|
613
615
|
if (mt?.[1] !== undefined) { // tag
|
|
614
616
|
const closing = mt[1].startsWith('/');
|
|
615
617
|
return getCompletion(allTags, 'Class', mt[1].slice(closing ? 1 : 0), position, closing && !curLine?.slice(character).trim().startsWith('>') ? '>' : '');
|
package/dist/lib/title.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export declare class Title {
|
|
|
46
46
|
*/
|
|
47
47
|
constructor(title: string, defaultNs: number, config: Config, { temporary, decode, selfLink, page }?: TitleOptions);
|
|
48
48
|
/**
|
|
49
|
-
* Check if the title is a redirect
|
|
49
|
+
* Check if the title is a redirect and get the redirect target
|
|
50
50
|
*
|
|
51
|
-
*
|
|
51
|
+
* 检测是否是重定向并获取重定向目标
|
|
52
52
|
* @since v1.12.2
|
|
53
53
|
*/
|
|
54
54
|
getRedirection(): [boolean, string];
|
package/dist/lib/title.js
CHANGED
|
@@ -134,8 +134,9 @@ class Title {
|
|
|
134
134
|
/**
|
|
135
135
|
* 生成标题
|
|
136
136
|
* @param prefix 前缀
|
|
137
|
+
* @param redirect 是否允许重定向
|
|
137
138
|
*/
|
|
138
|
-
#getTitle(prefix) {
|
|
139
|
+
#getTitle(prefix, redirect = true) {
|
|
139
140
|
let title = (prefix + this.main).replace(/ /gu, '_');
|
|
140
141
|
if (title.startsWith('/')) {
|
|
141
142
|
title = (this.page ?? '') + title.replace(/(.)\/$/u, '$1');
|
|
@@ -149,9 +150,9 @@ class Title {
|
|
|
149
150
|
return [false, title];
|
|
150
151
|
}
|
|
151
152
|
/**
|
|
152
|
-
* Check if the title is a redirect
|
|
153
|
+
* Check if the title is a redirect and get the redirect target
|
|
153
154
|
*
|
|
154
|
-
*
|
|
155
|
+
* 检测是否是重定向并获取重定向目标
|
|
155
156
|
* @since v1.12.2
|
|
156
157
|
*/
|
|
157
158
|
getRedirection() {
|
|
@@ -29,7 +29,7 @@ const parseHrAndDoubleUnderscore = ({ firstChild: { data }, type, name }, config
|
|
|
29
29
|
if (caseSensitive || caseInsensitive) {
|
|
30
30
|
// @ts-expect-error abstract class
|
|
31
31
|
new doubleUnderscore_1.DoubleUnderscoreToken(key, caseSensitive, Boolean(p4), config, accum);
|
|
32
|
-
return `\0${accum.length - 1}${caseInsensitive && (aliases
|
|
32
|
+
return `\0${accum.length - 1}${caseInsensitive && (aliases[lc] ?? /* c8 ignore next */ lc) === 'toc' ? 'u' : 'n'}\x7F`;
|
|
33
33
|
}
|
|
34
34
|
return m;
|
|
35
35
|
});
|
package/dist/parser/table.js
CHANGED
|
@@ -89,7 +89,7 @@ const parseTable = ({ firstChild: { data }, type, name }, config, accum) => {
|
|
|
89
89
|
else if (row) {
|
|
90
90
|
top = pop(top, stack);
|
|
91
91
|
if (top.is('tr')) {
|
|
92
|
-
top = stack.pop();
|
|
92
|
+
top = stack.pop(); // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
|
|
93
93
|
}
|
|
94
94
|
// @ts-expect-error abstract class
|
|
95
95
|
const tr = new tr_1.TrToken(`\n${spaces}${row}`, attr, config, accum);
|
package/dist/src/attribute.js
CHANGED
|
@@ -135,7 +135,7 @@ class AttributeToken extends index_2.Token {
|
|
|
135
135
|
// 不支持通用HTML属性的扩展标签
|
|
136
136
|
type === 'ext-attr' && !attrs2
|
|
137
137
|
// 或非通用HTML属性
|
|
138
|
-
|| !/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(name)
|
|
138
|
+
|| !/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:_]*)$/u.test(name)
|
|
139
139
|
&& (tag === 'meta' || tag === 'link' || !sharable_1.commonHtmlAttrs.has(name)))
|
|
140
140
|
|| (name === 'itemtype' || name === 'itemid' || name === 'itemref')
|
|
141
141
|
&& !parentNode?.hasAttr('itemscope')) {
|
package/dist/src/link/base.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import Parser from '../../index';
|
|
1
2
|
import { Token } from '../index';
|
|
2
3
|
import { AtomToken } from '../atom';
|
|
3
|
-
import type {
|
|
4
|
+
import type { LintError } from '../../base';
|
|
4
5
|
import type { Title } from '../../lib/title';
|
|
5
6
|
/**
|
|
6
7
|
* internal link
|
|
@@ -22,5 +23,5 @@ export declare abstract class LinkBaseToken extends Token {
|
|
|
22
23
|
* @param linkText 链接显示文字
|
|
23
24
|
* @param delimiter `|`
|
|
24
25
|
*/
|
|
25
|
-
constructor(link: string, linkText?: string, config?: Config, accum?: Token[], delimiter?: string);
|
|
26
|
+
constructor(link: string, linkText?: string, config?: Parser.Config, accum?: Token[], delimiter?: string);
|
|
26
27
|
}
|
package/dist/src/link/base.js
CHANGED
|
@@ -81,11 +81,11 @@ let LinkBaseToken = (() => {
|
|
|
81
81
|
* @param linkText 链接显示文字
|
|
82
82
|
* @param delimiter `|`
|
|
83
83
|
*/
|
|
84
|
-
constructor(link, linkText, config, accum = [], delimiter = '|') {
|
|
84
|
+
constructor(link, linkText, config = index_1.default.getConfig(), accum = [], delimiter = '|') {
|
|
85
85
|
super(undefined, config, accum, {});
|
|
86
86
|
this.insertAt(new atom_1.AtomToken(link, 'link-target', config, accum, {}));
|
|
87
87
|
if (linkText !== undefined) {
|
|
88
|
-
const inner = new index_2.Token(linkText, config,
|
|
88
|
+
const inner = new index_2.Token(linkText, { ...config, excludes: [...config.excludes, 'list'] }, accum);
|
|
89
89
|
inner.type = 'link-text';
|
|
90
90
|
inner.setAttribute('stage', constants_1.MAX_STAGE - 1);
|
|
91
91
|
this.insertAt(inner);
|
|
@@ -70,7 +70,7 @@ let DoubleUnderscoreToken = (() => {
|
|
|
70
70
|
constructor(word, sensitive, fullWidth, config, accum) {
|
|
71
71
|
super(word, config, accum);
|
|
72
72
|
const lc = word.toLowerCase(), [, , iAlias, sAlias] = config.doubleUnderscore;
|
|
73
|
-
this.setAttribute('name', (sensitive ? sAlias
|
|
73
|
+
this.setAttribute('name', (sensitive ? sAlias[word]?.toLowerCase() : iAlias[lc]) ?? lc);
|
|
74
74
|
this.#fullWidth = fullWidth;
|
|
75
75
|
}
|
|
76
76
|
/** @private */
|
package/dist/util/string.js
CHANGED
|
@@ -55,7 +55,7 @@ const decodeHtml = (str) => {
|
|
|
55
55
|
if (typeof process === 'object' && typeof process.versions?.node === 'string') {
|
|
56
56
|
try {
|
|
57
57
|
const { decodeHTMLStrict } = require('entities');
|
|
58
|
-
return (s) => decodeHTMLStrict(s).
|
|
58
|
+
return (s) => decodeHTMLStrict(s).replaceAll('\xA0', ' ');
|
|
59
59
|
}
|
|
60
60
|
catch /* c8 ignore next */ { }
|
|
61
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikilint",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.39.1",
|
|
4
4
|
"description": "A Node.js linter for MediaWiki markup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"url": "git+https://github.com/bhsd-harry/wikiparser-node.git"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
+
"ls": "npm i --package-lock-only && npm ls --package-lock-only --all --omit=dev",
|
|
42
43
|
"prepublishOnly": "npm run build:core",
|
|
43
44
|
"build:core": "bash build.sh",
|
|
44
45
|
"build:define": "bash sed.sh -i \"s/pkg = \\$PKG/pkg = $(npm pkg get name)/; s/version = \\$VERSION/version = $(npm pkg get version)/\" dist/bin/config.js",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
"dependencies": {
|
|
76
77
|
"@bhsd/cm-util": "^1.0.0",
|
|
77
78
|
"@bhsd/common": "^2.0.0",
|
|
78
|
-
"@bhsd/stylelint-util": "^1.0.
|
|
79
|
+
"@bhsd/stylelint-util": "^1.0.2",
|
|
79
80
|
"binary-search": "^1.3.6",
|
|
80
81
|
"vscode-languageserver-types": "^3.17.5"
|
|
81
82
|
},
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
"color-name": "^2.0.0",
|
|
84
85
|
"entities": "^8.0.0",
|
|
85
86
|
"mathoid-texvcjs": "^0.6.0",
|
|
86
|
-
"stylelint": "^17.
|
|
87
|
+
"stylelint": "^17.9.0",
|
|
87
88
|
"vscode-css-languageservice": "^6.3.10",
|
|
88
89
|
"vscode-html-languageservice": "^5.6.2",
|
|
89
90
|
"vscode-json-languageservice": "^5.7.2"
|
|
@@ -91,32 +92,35 @@
|
|
|
91
92
|
"devDependencies": {
|
|
92
93
|
"@bhsd/code-standard": "^2.2.0",
|
|
93
94
|
"@bhsd/nodejs": "^1.0.0",
|
|
94
|
-
"@bhsd/test-util": "^1.
|
|
95
|
+
"@bhsd/test-util": "^1.1.0",
|
|
95
96
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
96
97
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
97
98
|
"@types/color-name": "^2.0.0",
|
|
98
99
|
"@types/color-rgba": "^2.1.3",
|
|
99
100
|
"@types/mocha": "^10.0.10",
|
|
100
101
|
"@types/node": "^24.11.0",
|
|
101
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
102
|
-
"@typescript-eslint/parser": "^8.
|
|
102
|
+
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
103
|
+
"@typescript-eslint/parser": "^8.59.0",
|
|
103
104
|
"c8": "^11.0.0",
|
|
104
105
|
"color-rgba": "^3.0.0",
|
|
105
106
|
"diff2html-cli": "^5.2.15",
|
|
106
|
-
"esbuild": "^0.
|
|
107
|
-
"eslint": "^10.2.
|
|
108
|
-
"eslint-plugin-jsdoc": "^62.
|
|
107
|
+
"esbuild": "^0.28.0",
|
|
108
|
+
"eslint": "^10.2.1",
|
|
109
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
109
110
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
110
111
|
"eslint-plugin-n": "^17.24.0",
|
|
111
112
|
"eslint-plugin-promise": "^7.2.1",
|
|
112
113
|
"eslint-plugin-regexp": "^3.1.0",
|
|
113
114
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
114
|
-
"markdownlint-cli2": "^0.
|
|
115
|
+
"markdownlint-cli2": "^0.22.1",
|
|
115
116
|
"mocha": "^11.7.5",
|
|
116
|
-
"typescript": "^6.0.
|
|
117
|
+
"typescript": "^6.0.3",
|
|
117
118
|
"v8r": "^6.0.0",
|
|
118
119
|
"vscode-languageserver-textdocument": "^1.0.12"
|
|
119
120
|
},
|
|
121
|
+
"overrides": {
|
|
122
|
+
"eslint": "^10.2.1"
|
|
123
|
+
},
|
|
120
124
|
"engines": {
|
|
121
125
|
"node": "^20.19.0 || ^22.13.0 || >=24.11.0"
|
|
122
126
|
}
|