@electron/lint-roller 1.10.0 → 1.10.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/markdownlint-rules/emd001.js +11 -5
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const { addError, getLineMetadata, getReferenceLinkImageData } = require('markdownlint/helpers');
|
|
2
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
|
+
|
|
3
7
|
module.exports = {
|
|
4
8
|
names: ['EMD001', 'no-shortcut-reference-links'],
|
|
5
9
|
description: 'Disallow shortcut reference links (those with no link label)',
|
|
@@ -9,11 +13,13 @@ module.exports = {
|
|
|
9
13
|
const { shortcuts } = getReferenceLinkImageData(lineMetadata);
|
|
10
14
|
for (const [shortcut, occurrences] of shortcuts) {
|
|
11
15
|
for (const [lineNumber] of occurrences) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
25
|
},
|