@electron/lint-roller 1.13.0 → 2.1.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/bin/markdownlint-cli-wrapper.js +1 -1
- package/dist/bin/markdownlint-cli-wrapper.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 +2428 -437
- package/markdownlint-rules/emd002.mjs +17 -5
- package/markdownlint-rules/emd003.js +2425 -437
- package/markdownlint-rules/emd003.mjs +14 -5
- package/markdownlint-rules/index.js +4 -0
- package/package.json +19 -18
- package/markdownlint-rules/emd001.js +0 -26
|
@@ -4,7 +4,8 @@ import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
|
4
4
|
import { visit } from 'unist-util-visit';
|
|
5
5
|
|
|
6
6
|
export const names = ['EMD002', 'no-angle-brackets'];
|
|
7
|
-
export const description =
|
|
7
|
+
export const description =
|
|
8
|
+
'No unescaped opening angle brackets in text (does not play nice with MDX)';
|
|
8
9
|
export const tags = ['brackets'];
|
|
9
10
|
|
|
10
11
|
const UNESCAPED_REGEX = /(?<!\\)<(?!\s)/g;
|
|
@@ -32,16 +33,27 @@ function EMD002(params, onError) {
|
|
|
32
33
|
tree,
|
|
33
34
|
(node) => node.type === 'text',
|
|
34
35
|
(node) => {
|
|
35
|
-
const rawContent = childToken.line.slice(
|
|
36
|
+
const rawContent = childToken.line.slice(
|
|
37
|
+
node.position.start.offset,
|
|
38
|
+
node.position.end.offset,
|
|
39
|
+
);
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
const matches = rawContent.matchAll(UNESCAPED_REGEX);
|
|
42
|
+
|
|
43
|
+
for (const match of matches) {
|
|
44
|
+
addError(
|
|
45
|
+
onError,
|
|
46
|
+
childToken.lineNumber,
|
|
47
|
+
'Unescaped opening angle bracket',
|
|
48
|
+
undefined,
|
|
49
|
+
[node.position.start.offset + 1 + match.index, 1],
|
|
50
|
+
);
|
|
39
51
|
}
|
|
40
52
|
},
|
|
41
53
|
);
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
});
|
|
45
|
-
}
|
|
57
|
+
}
|
|
46
58
|
|
|
47
59
|
export { EMD002 as function };
|