wikilint 2.43.0 → 2.45.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.
Files changed (94) hide show
  1. package/config/default.json +32 -2
  2. package/config/enwiki.json +1 -1
  3. package/config/jawiki.json +1 -1
  4. package/config/minimum.json +1 -1
  5. package/config/moegirl.json +39 -1
  6. package/config/zhwiki.json +1 -1
  7. package/data/ext/templatedata.json +13 -5
  8. package/data/signatures.json +38 -32
  9. package/dist/base.d.mts +5 -5
  10. package/dist/base.d.ts +5 -5
  11. package/dist/base.js +1 -0
  12. package/dist/base.mjs +1 -0
  13. package/dist/bin/config.js +6 -5
  14. package/dist/index.js +9 -6
  15. package/dist/internal.d.ts +6 -1
  16. package/dist/lib/document.d.ts +17 -14
  17. package/dist/lib/element.js +5 -5
  18. package/dist/lib/lintConfig.js +11 -1
  19. package/dist/lib/lsp.d.ts +1 -2
  20. package/dist/lib/lsp.js +18 -42
  21. package/dist/lib/node.js +2 -2
  22. package/dist/lib/text.js +2 -2
  23. package/dist/lib/title.d.ts +4 -1
  24. package/dist/lib/title.js +5 -1
  25. package/dist/map.d.ts +4 -1
  26. package/dist/mixin/attributesParent.js +1 -1
  27. package/dist/mixin/elementLike.js +29 -31
  28. package/dist/mixin/hidden.js +0 -1
  29. package/dist/mixin/paramLineParent.d.ts +26 -0
  30. package/dist/mixin/paramLineParent.js +51 -0
  31. package/dist/parser/converter.js +1 -1
  32. package/dist/src/arg.js +17 -35
  33. package/dist/src/atom.d.ts +1 -1
  34. package/dist/src/atom.js +2 -0
  35. package/dist/src/attribute.js +10 -5
  36. package/dist/src/attributes.d.ts +1 -0
  37. package/dist/src/attributes.js +41 -15
  38. package/dist/src/commented.d.ts +1 -0
  39. package/dist/src/commented.js +1 -3
  40. package/dist/src/converterFlags.js +17 -8
  41. package/dist/src/converterRule.js +3 -3
  42. package/dist/src/funcTag.d.ts +23 -0
  43. package/dist/src/funcTag.js +85 -0
  44. package/dist/src/heading.js +8 -3
  45. package/dist/src/hidden.d.ts +3 -2
  46. package/dist/src/hidden.js +29 -5
  47. package/dist/src/imageParameter.d.ts +4 -3
  48. package/dist/src/imageParameter.js +29 -9
  49. package/dist/src/index.js +2 -2
  50. package/dist/src/link/base.js +14 -2
  51. package/dist/src/link/categorytree.d.ts +2 -0
  52. package/dist/src/link/categorytree.js +8 -5
  53. package/dist/src/link/file.d.ts +5 -4
  54. package/dist/src/link/file.js +19 -13
  55. package/dist/src/multiLine/charinsert.d.ts +16 -0
  56. package/dist/src/multiLine/charinsert.js +84 -0
  57. package/dist/src/multiLine/gallery.js +4 -4
  58. package/dist/src/multiLine/imagemap.d.ts +1 -1
  59. package/dist/src/multiLine/imagemap.js +7 -7
  60. package/dist/src/multiLine/index.d.ts +3 -0
  61. package/dist/src/multiLine/index.js +79 -18
  62. package/dist/src/multiLine/inputbox.d.ts +1 -0
  63. package/dist/src/multiLine/paramTag.d.ts +3 -0
  64. package/dist/src/multiLine/paramTag.js +60 -13
  65. package/dist/src/nested.js +7 -7
  66. package/dist/src/nowiki/index.d.ts +1 -0
  67. package/dist/src/nowiki/index.js +39 -28
  68. package/dist/src/nowiki/quote.js +6 -5
  69. package/dist/src/paramLine.d.ts +17 -3
  70. package/dist/src/paramLine.js +123 -31
  71. package/dist/src/parameter.d.ts +6 -0
  72. package/dist/src/parameter.js +15 -1
  73. package/dist/src/singleLine/charinsertLine.d.ts +21 -0
  74. package/dist/src/singleLine/charinsertLine.js +69 -0
  75. package/dist/src/{imagemapLink.d.ts → singleLine/imagemapLink.d.ts} +8 -7
  76. package/dist/src/singleLine/imagemapLink.js +95 -0
  77. package/dist/src/singleLine/index.d.ts +10 -0
  78. package/dist/src/singleLine/index.js +16 -0
  79. package/dist/src/tag/html.js +26 -8
  80. package/dist/src/tag/index.js +18 -17
  81. package/dist/src/tagPair/ext.d.ts +1 -0
  82. package/dist/src/tagPair/ext.js +59 -5
  83. package/dist/src/tagPair/index.js +1 -10
  84. package/dist/src/transclude.js +13 -13
  85. package/dist/util/sharable.js +22 -0
  86. package/dist/util/sharable.mjs +22 -0
  87. package/dist/util/string.js +33 -2
  88. package/dist/vendor/search.js +34 -0
  89. package/i18n/en.json +11 -0
  90. package/i18n/zh-hans.json +11 -0
  91. package/i18n/zh-hant.json +11 -0
  92. package/package.json +16 -25
  93. package/dist/src/imagemapLink.js +0 -34
  94. package/dist/util/search.js +0 -16
package/i18n/en.json CHANGED
@@ -14,6 +14,7 @@
14
14
  "delink": null,
15
15
  "duplicate-attribute": "duplicate $1 attribute",
16
16
  "duplicate-category": "duplicate category",
17
+ "duplicate-ext-parameter": "duplicate parameter of <$1>",
17
18
  "duplicate-id": "duplicate HTML id",
18
19
  "duplicate-image-parameter": "duplicate image $1 parameter",
19
20
  "duplicate-parameter": "duplicate template parameter",
@@ -34,10 +35,12 @@
34
35
  "in-url": "$1 in URL",
35
36
  "inconsistent-table": "inconsistent table layout",
36
37
  "insecure-style": "insecure style",
38
+ "int-name": "name cannot be a simple integer",
37
39
  "invalid-attribute": "element containing an invalid attribute name",
38
40
  "invalid-category": "invalid category name",
39
41
  "invalid-content": "invalid content in <$1>",
40
42
  "invalid-conversion-flag": "invalid conversion flag",
43
+ "invalid-coord": "invalid coordinates",
41
44
  "invalid-gallery": "invalid gallery image",
42
45
  "invalid-gallery-link": "invalid link in gallery image",
43
46
  "invalid-image-parameter": "invalid image parameter",
@@ -45,6 +48,7 @@
45
48
  "invalid-isbn": "invalid ISBN",
46
49
  "invalid-parameter": "invalid parameter of <$1>",
47
50
  "invalid-self-closing": "invalid self-closing tag",
51
+ "invalid-space": "invalid whitespace in <$1>",
48
52
  "invalid-thumb": "invalid thumbnail filename",
49
53
  "invalid-url": "invalid URL",
50
54
  "invisible-triple-braces": "invisible content inside triple braces",
@@ -55,6 +59,9 @@
55
59
  "missing-extension": "missing file extension",
56
60
  "missing-function": "missing Scribunto module function name",
57
61
  "newline": null,
62
+ "no-empty": "<$1> should not be empty",
63
+ "no-empty-in-references": "<ref> tag defined in <references> has no content",
64
+ "no-named-in-references": "<ref> tag defined in <references> has no name attribute",
58
65
  "no-self-closing": "no self-closing",
59
66
  "nonzero-tabindex": "nonzero tabindex",
60
67
  "nothing-in": "nothing should be in <$1>",
@@ -65,7 +72,10 @@
65
72
  "pipe-in-link": "additional \"|\" in the link text",
66
73
  "pipe-in-table": "additional \"|\" in a table cell",
67
74
  "redirect-like": "redirect-like syntax in a list item",
75
+ "ref-details": "a <ref> tag with details must contain content or point to a parent reference by name",
76
+ "ref-follow": "a <ref follow> tag that is the continuation of a previous one cannot be named individually or have details",
68
77
  "ref-in-link": "<ref> in an internal or external link",
78
+ "ref-no-name": "<ref> with no name must have content",
69
79
  "remove": null,
70
80
  "required-attribute": "required $1 attribute is missing",
71
81
  "template-in-link": "template in an internal link target",
@@ -79,6 +89,7 @@
79
89
  "unexpected-argument": "unexpected template argument",
80
90
  "unmatched-closing": "unmatched closing tag",
81
91
  "unnecessary-encoding": "unnecessary percent-encoding in an internal link",
92
+ "unrecognized-shape": "unrecognized shape, which must be one of \"default\", \"rect\", \"circle\", or \"poly\"",
82
93
  "uppercase": null,
83
94
  "useless-attribute": "useless attribute",
84
95
  "useless-fragment": "useless fragment",
package/i18n/zh-hans.json CHANGED
@@ -14,6 +14,7 @@
14
14
  "delink": "移除链接",
15
15
  "duplicate-attribute": "重复的$1属性",
16
16
  "duplicate-category": "重复的分类",
17
+ "duplicate-ext-parameter": "重复的<$1>参数",
17
18
  "duplicate-id": "重复的HTML id属性",
18
19
  "duplicate-image-parameter": "重复的图像$1参数",
19
20
  "duplicate-parameter": "重复的模板参数",
@@ -33,11 +34,13 @@
33
34
  "imagemap-without-image": "没有图像的<imagemap>",
34
35
  "in-url": "URL中的$1",
35
36
  "inconsistent-table": "不一致的表格布局",
37
+ "int-name": "name不能是单纯整数",
36
38
  "insecure-style": "不安全的样式",
37
39
  "invalid-attribute": "包含无效属性名称的元素",
38
40
  "invalid-category": "无效的分类名",
39
41
  "invalid-content": "<$1>中的无效内容",
40
42
  "invalid-conversion-flag": "无效的转换旗标",
43
+ "invalid-coord": "不正确的坐标",
41
44
  "invalid-gallery": "无效的图库图像",
42
45
  "invalid-gallery-link": "图库图像中的无效链接",
43
46
  "invalid-image-parameter": "无效的图像参数",
@@ -45,6 +48,7 @@
45
48
  "invalid-isbn": "无效的ISBN",
46
49
  "invalid-parameter": "无效的<$1>参数",
47
50
  "invalid-self-closing": "无效自封闭标签",
51
+ "invalid-space": "<$1>中的无效空白字符",
48
52
  "invalid-thumb": "无效的缩略图文件名",
49
53
  "invalid-url": "无效的URL",
50
54
  "invisible-triple-braces": "三重括号内的不可见内容",
@@ -55,6 +59,9 @@
55
59
  "missing-extension": "缺少文件扩展名",
56
60
  "missing-function": "缺少Scribunto模块函数名",
57
61
  "newline": "换行",
62
+ "no-empty": "<$1>不应为空",
63
+ "no-empty-in-references": "<references>内定义的<ref>标签没有内容",
64
+ "no-named-in-references": "<references>内定义的<ref>标签没有设置name属性",
58
65
  "no-self-closing": "移除自封闭",
59
66
  "nonzero-tabindex": "非零的tabindex",
60
67
  "nothing-in": "<$1>不应有任何内容",
@@ -65,7 +72,10 @@
65
72
  "pipe-in-link": "链接文本中的额外\"|\"",
66
73
  "pipe-in-table": "表格单元格中的额外\"|\"",
67
74
  "redirect-like": "列表项中的疑似重定向语法",
75
+ "ref-details": "带有详细信息的<ref>标签必须包含内容或通过名称指向父级参考",
76
+ "ref-follow": "作为前一个标签的延续的<ref follow>标签不能被单独命名或包含详细信息",
68
77
  "ref-in-link": "内部或外部链接中的<ref>",
78
+ "ref-no-name": "没有name的<ref>必须有内容",
69
79
  "remove": "移除",
70
80
  "required-attribute": "缺少必需的$1属性",
71
81
  "template-in-link": "内部链接目标中的模板",
@@ -79,6 +89,7 @@
79
89
  "unexpected-argument": "未预期的模板参数",
80
90
  "unmatched-closing": "未匹配的结束标签",
81
91
  "unnecessary-encoding": "内部链接中不必要的百分号编码",
92
+ "unrecognized-shape": "未能认出的形状,必须是这些字面量:\"default\"、\"rect\"、\"circle\"、\"poly\"",
82
93
  "uppercase": "大写",
83
94
  "useless-attribute": "无用的属性",
84
95
  "useless-fragment": "无用的片段",
package/i18n/zh-hant.json CHANGED
@@ -14,6 +14,7 @@
14
14
  "delink": "解除連結",
15
15
  "duplicate-attribute": "重複的$1屬性",
16
16
  "duplicate-category": "重複的分類",
17
+ "duplicate-ext-parameter": "重複的<$1>參數",
17
18
  "duplicate-id": "重複的HTML id屬性",
18
19
  "duplicate-image-parameter": "重複的圖片$1參數",
19
20
  "duplicate-parameter": "重複的模板參數",
@@ -33,11 +34,13 @@
33
34
  "imagemap-without-image": "<imagemap>沒有圖片",
34
35
  "in-url": "URL中有$1",
35
36
  "inconsistent-table": "表格版面不一致",
37
+ "int-name": "name屬性不能使用數字",
36
38
  "insecure-style": "不安全的樣式",
37
39
  "invalid-attribute": "包含無效屬性名稱的元素",
38
40
  "invalid-category": "無效的分類名",
39
41
  "invalid-content": "<$1>有無效內容",
40
42
  "invalid-conversion-flag": "無效的轉換旗標",
43
+ "invalid-coord": "不正確的座標",
41
44
  "invalid-gallery": "無效的圖庫圖片",
42
45
  "invalid-gallery-link": "圖庫圖片裡有無效連結",
43
46
  "invalid-image-parameter": "無效的圖片參數",
@@ -45,6 +48,7 @@
45
48
  "invalid-isbn": "無效的ISBN",
46
49
  "invalid-parameter": "無效的<$1>參數",
47
50
  "invalid-self-closing": "無效自封閉標籤",
51
+ "invalid-space": "<$1>裡有無效空白字元",
48
52
  "invalid-thumb": "無效的縮略圖檔名",
49
53
  "invalid-url": "無效的URL",
50
54
  "invisible-triple-braces": "三重括號內有不可見內容",
@@ -55,6 +59,9 @@
55
59
  "missing-extension": "缺少副檔名",
56
60
  "missing-function": "缺少Scribunto模組函式名稱",
57
61
  "newline": "換行",
62
+ "no-empty": "<$1>不應為空",
63
+ "no-empty-in-references": "<references>內定義的<ref>標籤沒有內容",
64
+ "no-named-in-references": "<references> 中定義的 <ref> 沒有設定 name 屬性",
58
65
  "no-self-closing": "移除自封閉",
59
66
  "nonzero-tabindex": "非零的tabindex",
60
67
  "nothing-in": "<$1>不應有任何內容",
@@ -65,7 +72,10 @@
65
72
  "pipe-in-link": "連結文字有額外的\"|\"字元",
66
73
  "pipe-in-table": "表格儲存格有額外的\"|\"字元",
67
74
  "redirect-like": "列表項中的疑似重新導向語法",
75
+ "ref-details": "一個帶有詳細資訊的 <ref> 標籤必須包含內容、或透過名稱指向父級參考",
76
+ "ref-follow": "作為前一個延續的 <ref follow> 標籤,不能單獨命名或包含詳細資訊",
68
77
  "ref-in-link": "內部或外部連結裡的<ref>",
78
+ "ref-no-name": "沒有名稱的<ref>必須要有內容",
69
79
  "remove": "移除",
70
80
  "required-attribute": "缺少必需的$1屬性",
71
81
  "template-in-link": "內部連結目標中的模板",
@@ -79,6 +89,7 @@
79
89
  "unexpected-argument": "未預期的模板參數",
80
90
  "unmatched-closing": "未匹配的結束標籤",
81
91
  "unnecessary-encoding": "內部連結中有不需要的百分比編碼",
92
+ "unrecognized-shape": "無法辨識的形狀,必須使用下列其中一組字:\"default\"、\"rect\"、\"circle\"或\"poly\"",
82
93
  "uppercase": "大寫",
83
94
  "useless-attribute": "無用屬性",
84
95
  "useless-fragment": "無用的片段內容",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikilint",
3
- "version": "2.43.0",
3
+ "version": "2.45.0",
4
4
  "description": "A Node.js linter for MediaWiki markup",
5
5
  "keywords": [
6
6
  "mediawiki",
@@ -39,7 +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
+ "ls": "npm i --package-lock-only && npm ls --package-lock-only --all --include=peer --omit=dev",
43
43
  "prepublishOnly": "npm run build:core",
44
44
  "build:core": "bash build.sh",
45
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",
@@ -73,16 +73,7 @@
73
73
  "json-summary"
74
74
  ]
75
75
  },
76
- "dependencies": {
77
- "@bhsd/cm-util": "^2.1.0",
78
- "@bhsd/common": "^2.2.1",
79
- "@bhsd/stylelint-util": "^1.0.3",
80
- "binary-search": "^1.3.6",
81
- "entities": "^8.0.0",
82
- "vscode-languageserver-types": "^3.17.5"
83
- },
84
76
  "peerDependencies": {
85
- "color-name": ">=2.0.0",
86
77
  "mathoid-texvcjs": ">=0.4.0",
87
78
  "stylelint": ">=16.0.0",
88
79
  "vscode-css-languageservice": ">=3.0.0",
@@ -90,9 +81,6 @@
90
81
  "vscode-json-languageservice": ">=3.2.0"
91
82
  },
92
83
  "peerDependenciesMeta": {
93
- "color-name": {
94
- "optional": true
95
- },
96
84
  "mathoid-texvcjs": {
97
85
  "optional": true
98
86
  },
@@ -109,22 +97,25 @@
109
97
  "optional": true
110
98
  }
111
99
  },
100
+ "dependencies": {
101
+ "@bhsd/cm-util": "^2.2.0",
102
+ "@bhsd/common": "^3.0.0",
103
+ "@bhsd/stylelint-util": "^1.1.0",
104
+ "entities": "^8.0.0",
105
+ "vscode-languageserver-types": "^3.18.0"
106
+ },
112
107
  "devDependencies": {
113
- "@bhsd/code-standard": "^2.6.2",
114
- "@bhsd/nodejs": "^1.0.1",
115
- "@bhsd/test-util": "^1.5.0",
116
- "@types/color-name": "^2.0.0",
117
- "@types/color-rgba": "^2.1.3",
108
+ "@bhsd/code-standard": "^3.1.0",
109
+ "@bhsd/nodejs": "^1.1.0",
110
+ "@bhsd/test-util": "^2.0.0",
118
111
  "c8": "^11.0.0",
119
- "color-name": "~2.0.2",
120
- "color-rgba": "^3.0.0",
121
112
  "diff2html-cli": "^5.2.15",
122
- "esbuild": "^0.28.0",
123
- "eslint": "^10.4.1",
124
- "markdownlint-cli2": "^0.22.1",
113
+ "esbuild": "^0.28.1",
114
+ "eslint": "^10.6.0",
115
+ "markdownlint-cli2": "^0.23.0",
125
116
  "mathoid-texvcjs": "^0.6.0",
126
117
  "mocha": "^11.7.6",
127
- "stylelint": "^17.12.0",
118
+ "stylelint": "^17.14.0",
128
119
  "typescript": "^6.0.3",
129
120
  "v8r": "^6.1.0",
130
121
  "vscode-css-languageservice": "^6.3.10",
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImagemapLinkToken = void 0;
4
- const index_1 = require("./index");
5
- const noinclude_1 = require("./nowiki/noinclude");
6
- const index_2 = require("./link/index");
7
- const extLink_1 = require("./extLink");
8
- /**
9
- * link inside the `<imagemap>`
10
- *
11
- * `<imagemap>`内的链接
12
- * @classdesc `{childNodes: [AstText, LinkToken|ExtLinkToken, NoincludeToken]}`
13
- */
14
- class ImagemapLinkToken extends index_1.Token {
15
- get type() {
16
- return 'imagemap-link';
17
- }
18
- /**
19
- * @param pre 链接前的文本
20
- * @param linkStuff 内外链接
21
- * @param post 链接后的文本
22
- */
23
- constructor(pre, linkStuff, post, config, accum = []) {
24
- super(undefined, config, accum);
25
- this.append(pre, linkStuff.length === 2
26
- // @ts-expect-error abstract class
27
- ? new index_2.LinkToken(...linkStuff, config, accum)
28
- // @ts-expect-error abstract class
29
- : new extLink_1.ExtLinkToken(...linkStuff, config, accum),
30
- // @ts-expect-error abstract class
31
- new noinclude_1.NoincludeToken(post, config, accum));
32
- }
33
- }
34
- exports.ImagemapLinkToken = ImagemapLinkToken;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const binary_search_1 = __importDefault(require("binary-search"));
7
- /**
8
- * 二分法查找索引
9
- * @param haystack 数组
10
- * @param needle 目标值
11
- * @param comparator 比较函数
12
- */
13
- exports.default = (haystack, needle, comparator) => {
14
- const found = (0, binary_search_1.default)(haystack, needle, comparator);
15
- return found < 0 ? ~found : found; // eslint-disable-line no-bitwise
16
- };