@electron/lint-roller 1.13.0 → 2.0.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 +6 -6
- package/configs/markdownlint.json +8 -5
- package/dist/bin/lint-markdown-links.js +1 -6
- package/dist/bin/lint-markdown-links.js.map +1 -1
- package/dist/bin/lint-markdown-standard.js +1 -1
- package/dist/bin/lint-markdown-standard.js.map +1 -1
- package/dist/bin/lint-markdown-ts-check.js +35 -73
- package/dist/bin/lint-markdown-ts-check.js.map +1 -1
- package/dist/lib/helpers.d.ts +8 -0
- package/dist/lib/helpers.js +15 -1
- package/dist/lib/helpers.js.map +1 -1
- package/lib/helpers.ts +24 -0
- package/markdownlint-rules/emd002.js +2415 -434
- package/markdownlint-rules/emd003.js +2415 -434
- package/package.json +15 -14
- package/markdownlint-rules/emd001.js +0 -26
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@electron/lint-roller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Markdown linting helpers for Electron org repos",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=18.0.0"
|
|
7
7
|
},
|
|
8
8
|
"bin": {
|
|
9
9
|
"electron-markdownlint": "./dist/bin/markdownlint-cli-wrapper.js",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"lint-roller-markdown-links": "./dist/bin/lint-markdown-links.js",
|
|
11
|
+
"lint-roller-markdown-standard": "./dist/bin/lint-markdown-standard.js",
|
|
12
|
+
"lint-roller-markdown-ts-check": "./dist/bin/lint-markdown-ts-check.js"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"configs",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsc && yarn run build:emd002 && yarn run build:emd003",
|
|
25
|
-
"build:emd002": "esbuild --platform=node --target=
|
|
26
|
-
"build:emd003": "esbuild --platform=node --target=
|
|
25
|
+
"build:emd002": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd002.js markdownlint-rules/emd002.mjs",
|
|
26
|
+
"build:emd003": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd003.js markdownlint-rules/emd003.mjs",
|
|
27
27
|
"prepublishOnly": "yarn run build",
|
|
28
28
|
"lint:eslint": "eslint \"{bin,lib,markdownlint-rules,tests}/**/*.{js,ts}\"",
|
|
29
29
|
"lint:eslint:fix": "eslint --fix \"{bin,lib,markdownlint-rules,tests}/**/*.{js,ts}\"",
|
|
@@ -52,25 +52,23 @@
|
|
|
52
52
|
"@types/markdown-it": "^13.0.6",
|
|
53
53
|
"@types/minimist": "^1.2.5",
|
|
54
54
|
"@types/node": "20.1.2",
|
|
55
|
-
"
|
|
56
|
-
"esbuild": "^0.20.1",
|
|
55
|
+
"esbuild": "^0.21.0",
|
|
57
56
|
"eslint": "^8.54.0",
|
|
58
|
-
"eslint-config-prettier": "^9.
|
|
57
|
+
"eslint-config-prettier": "^9.1.0",
|
|
59
58
|
"eslint-plugin-node": "^11.1.0",
|
|
60
59
|
"jest": "^29.7.0",
|
|
61
|
-
"prettier": "^3.
|
|
60
|
+
"prettier": "^3.2.5",
|
|
62
61
|
"ts-jest": "^29.1.1",
|
|
63
|
-
"typescript": "^5.
|
|
62
|
+
"typescript": "^5.4.5"
|
|
64
63
|
},
|
|
65
64
|
"dependencies": {
|
|
66
65
|
"@dsanders11/vscode-markdown-languageservice": "^0.3.0",
|
|
67
66
|
"balanced-match": "^2.0.0",
|
|
68
67
|
"glob": "^8.1.0",
|
|
69
68
|
"markdown-it": "^13.0.1",
|
|
70
|
-
"markdownlint-cli": "^0.
|
|
69
|
+
"markdownlint-cli": "^0.40.0",
|
|
71
70
|
"mdast-util-from-markdown": "^1.3.0",
|
|
72
71
|
"minimist": "^1.2.8",
|
|
73
|
-
"node-fetch": "^2.6.9",
|
|
74
72
|
"rimraf": "^4.4.1",
|
|
75
73
|
"standard": "^17.0.0",
|
|
76
74
|
"unist-util-visit": "^4.1.2",
|
|
@@ -85,5 +83,8 @@
|
|
|
85
83
|
"typescript": {
|
|
86
84
|
"optional": true
|
|
87
85
|
}
|
|
86
|
+
},
|
|
87
|
+
"resolutions": {
|
|
88
|
+
"jackspeak": "2.1.1"
|
|
88
89
|
}
|
|
89
90
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const { addError, getLineMetadata, getReferenceLinkImageData } = require('markdownlint/helpers');
|
|
2
|
-
|
|
3
|
-
// These are used by GitHub's "alert" extension to Markdown
|
|
4
|
-
// https://github.com/orgs/community/discussions/16925
|
|
5
|
-
const ALERT_KEYWORDS = ['!note', '!tip', '!important', '!warning', '!caution'];
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
names: ['EMD001', 'no-shortcut-reference-links'],
|
|
9
|
-
description: 'Disallow shortcut reference links (those with no link label)',
|
|
10
|
-
tags: ['images', 'links'],
|
|
11
|
-
function: function EMD001(params, onError) {
|
|
12
|
-
const lineMetadata = getLineMetadata(params);
|
|
13
|
-
const { shortcuts } = getReferenceLinkImageData(lineMetadata);
|
|
14
|
-
for (const [shortcut, occurrences] of shortcuts) {
|
|
15
|
-
for (const [lineNumber] of occurrences) {
|
|
16
|
-
if (!ALERT_KEYWORDS.includes(shortcut)) {
|
|
17
|
-
addError(
|
|
18
|
-
onError,
|
|
19
|
-
lineNumber + 1, // human-friendly line numbers (1-based)
|
|
20
|
-
`Disallowed shortcut reference link: "${shortcut}"`,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
};
|