eslint-plugin-markdown-preferences 0.8.0 → 0.10.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 +12 -4
- package/lib/index.d.ts +46 -2
- package/lib/index.js +1226 -83
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ For detailed usage instructions, rule configurations, and examples, visit our co
|
|
|
28
28
|
|
|
29
29
|
## 💿 Installation
|
|
30
30
|
|
|
31
|
-
```
|
|
31
|
+
```sh
|
|
32
32
|
npm install --save-dev eslint eslint-plugin-markdown-preferences
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ Example **eslint.config.js**:
|
|
|
50
50
|
```js
|
|
51
51
|
import { defineConfig } from "eslint/config";
|
|
52
52
|
// import markdown from "@eslint/markdown";
|
|
53
|
-
import markdownPreferences from
|
|
53
|
+
import markdownPreferences from "eslint-plugin-markdown-preferences";
|
|
54
54
|
export default [
|
|
55
55
|
// add more generic rule sets here, such as:
|
|
56
56
|
// markdown.configs.recommended,
|
|
@@ -59,8 +59,8 @@ export default [
|
|
|
59
59
|
rules: {
|
|
60
60
|
// override/add rules settings here, such as:
|
|
61
61
|
// 'markdown-preferences/prefer-linked-words': 'error'
|
|
62
|
-
}
|
|
63
|
-
}
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
64
|
];
|
|
65
65
|
```
|
|
66
66
|
|
|
@@ -86,6 +86,8 @@ The rules with the following star ⭐ are included in the configs.
|
|
|
86
86
|
|
|
87
87
|
<!--RULES_TABLE_START-->
|
|
88
88
|
|
|
89
|
+
<!-- prettier-ignore-start -->
|
|
90
|
+
|
|
89
91
|
### Preference Rules
|
|
90
92
|
|
|
91
93
|
| Rule ID | Description | Fixable | RECOMMENDED |
|
|
@@ -98,12 +100,18 @@ The rules with the following star ⭐ are included in the configs.
|
|
|
98
100
|
|
|
99
101
|
| Rule ID | Description | Fixable | RECOMMENDED |
|
|
100
102
|
|:--------|:------------|:-------:|:-----------:|
|
|
103
|
+
| [markdown-preferences/canonical-code-block-language](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/canonical-code-block-language.html) | enforce canonical language names in code blocks | 🔧 | |
|
|
101
104
|
| [markdown-preferences/definitions-last](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/definitions-last.html) | require link definitions and footnote definitions to be placed at the end of the document | 🔧 | |
|
|
102
105
|
| [markdown-preferences/hard-linebreak-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html) | enforce consistent hard linebreak style. | 🔧 | ⭐ |
|
|
106
|
+
| [markdown-preferences/heading-casing](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/heading-casing.html) | enforce consistent casing in headings. | 🔧 | |
|
|
107
|
+
| [markdown-preferences/no-laziness-blockquotes](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-laziness-blockquotes.html) | disallow laziness in blockquotes | | ⭐ |
|
|
108
|
+
| [markdown-preferences/no-multiple-empty-lines](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-multiple-empty-lines.html) | disallow multiple empty lines in Markdown files. | 🔧 | |
|
|
103
109
|
| [markdown-preferences/no-trailing-spaces](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-trailing-spaces.html) | disallow trailing whitespace at the end of lines in Markdown files. | 🔧 | |
|
|
104
110
|
| [markdown-preferences/prefer-link-reference-definitions](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-link-reference-definitions.html) | enforce using link reference definitions instead of inline links | 🔧 | |
|
|
105
111
|
| [markdown-preferences/sort-definitions](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/sort-definitions.html) | enforce a specific order for link definitions and footnote definitions | 🔧 | |
|
|
106
112
|
|
|
113
|
+
<!-- prettier-ignore-end -->
|
|
114
|
+
|
|
107
115
|
<!--RULES_TABLE_END-->
|
|
108
116
|
<!--RULES_SECTION_END-->
|
|
109
117
|
<!--DOCS_IGNORE_START-->
|
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ declare module 'eslint' {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
interface RuleOptions {
|
|
13
|
+
/**
|
|
14
|
+
* enforce canonical language names in code blocks
|
|
15
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/canonical-code-block-language.html
|
|
16
|
+
*/
|
|
17
|
+
'markdown-preferences/canonical-code-block-language'?: Linter.RuleEntry<MarkdownPreferencesCanonicalCodeBlockLanguage>;
|
|
13
18
|
/**
|
|
14
19
|
* require link definitions and footnote definitions to be placed at the end of the document
|
|
15
20
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/definitions-last.html
|
|
@@ -20,6 +25,21 @@ interface RuleOptions {
|
|
|
20
25
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html
|
|
21
26
|
*/
|
|
22
27
|
'markdown-preferences/hard-linebreak-style'?: Linter.RuleEntry<MarkdownPreferencesHardLinebreakStyle>;
|
|
28
|
+
/**
|
|
29
|
+
* enforce consistent casing in headings.
|
|
30
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/heading-casing.html
|
|
31
|
+
*/
|
|
32
|
+
'markdown-preferences/heading-casing'?: Linter.RuleEntry<MarkdownPreferencesHeadingCasing>;
|
|
33
|
+
/**
|
|
34
|
+
* disallow laziness in blockquotes
|
|
35
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-laziness-blockquotes.html
|
|
36
|
+
*/
|
|
37
|
+
'markdown-preferences/no-laziness-blockquotes'?: Linter.RuleEntry<[]>;
|
|
38
|
+
/**
|
|
39
|
+
* disallow multiple empty lines in Markdown files.
|
|
40
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-multiple-empty-lines.html
|
|
41
|
+
*/
|
|
42
|
+
'markdown-preferences/no-multiple-empty-lines'?: Linter.RuleEntry<MarkdownPreferencesNoMultipleEmptyLines>;
|
|
23
43
|
/**
|
|
24
44
|
* disallow text backslash at the end of a line.
|
|
25
45
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html
|
|
@@ -51,9 +71,25 @@ interface RuleOptions {
|
|
|
51
71
|
*/
|
|
52
72
|
'markdown-preferences/sort-definitions'?: Linter.RuleEntry<MarkdownPreferencesSortDefinitions>;
|
|
53
73
|
}
|
|
74
|
+
type MarkdownPreferencesCanonicalCodeBlockLanguage = [] | [{
|
|
75
|
+
languages?: {
|
|
76
|
+
[k: string]: string;
|
|
77
|
+
};
|
|
78
|
+
}];
|
|
54
79
|
type MarkdownPreferencesHardLinebreakStyle = [] | [{
|
|
55
80
|
style?: ("backslash" | "spaces");
|
|
56
81
|
}];
|
|
82
|
+
type MarkdownPreferencesHeadingCasing = [] | [{
|
|
83
|
+
style?: ("Title Case" | "Sentence case");
|
|
84
|
+
preserveWords?: string[];
|
|
85
|
+
ignorePatterns?: string[];
|
|
86
|
+
minorWords?: string[];
|
|
87
|
+
}];
|
|
88
|
+
type MarkdownPreferencesNoMultipleEmptyLines = [] | [{
|
|
89
|
+
max?: number;
|
|
90
|
+
maxEOF?: number;
|
|
91
|
+
maxBOF?: number;
|
|
92
|
+
}];
|
|
57
93
|
type MarkdownPreferencesNoTrailingSpaces = [] | [{
|
|
58
94
|
skipBlankLines?: boolean;
|
|
59
95
|
ignoreComments?: boolean;
|
|
@@ -107,19 +143,27 @@ declare namespace meta_d_exports {
|
|
|
107
143
|
export { name, version };
|
|
108
144
|
}
|
|
109
145
|
declare const name: "eslint-plugin-markdown-preferences";
|
|
110
|
-
declare const version: "0.
|
|
146
|
+
declare const version: "0.10.0";
|
|
111
147
|
//#endregion
|
|
112
148
|
//#region src/index.d.ts
|
|
113
149
|
declare const configs: {
|
|
114
150
|
recommended: typeof recommended_d_exports;
|
|
115
151
|
};
|
|
116
152
|
declare const rules: Record<string, RuleDefinition>;
|
|
153
|
+
declare const resources: {
|
|
154
|
+
defaultPreserveWords: string[];
|
|
155
|
+
defaultMinorWords: string[];
|
|
156
|
+
};
|
|
117
157
|
declare const _default: {
|
|
118
158
|
meta: typeof meta_d_exports;
|
|
119
159
|
configs: {
|
|
120
160
|
recommended: typeof recommended_d_exports;
|
|
121
161
|
};
|
|
122
162
|
rules: Record<string, RuleDefinition<_eslint_core0.RuleDefinitionTypeOptions>>;
|
|
163
|
+
resources: {
|
|
164
|
+
defaultPreserveWords: string[];
|
|
165
|
+
defaultMinorWords: string[];
|
|
166
|
+
};
|
|
123
167
|
};
|
|
124
168
|
//#endregion
|
|
125
|
-
export { RuleOptions, configs, _default as default, meta_d_exports as meta, rules };
|
|
169
|
+
export { RuleOptions, configs, _default as default, meta_d_exports as meta, resources, rules };
|