eslint-plugin-markdown-preferences 0.16.0 → 0.18.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 CHANGED
@@ -114,22 +114,30 @@ The rules with the following star ⭐ are included in the configs.
114
114
 
115
115
  | Rule ID | Description | Fixable | RECOMMENDED |
116
116
  |:--------|:------------|:-------:|:-----------:|
117
- | [markdown-preferences/atx-headings-closing-sequence-length](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-headings-closing-sequence-length.html) | enforce consistent length for the closing sequence (trailing #s) in ATX headings. | 🔧 | |
118
- | [markdown-preferences/atx-headings-closing-sequence](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-headings-closing-sequence.html) | enforce consistent use of closing sequence in ATX headings. | 🔧 | |
117
+ | [markdown-preferences/atx-heading-closing-sequence-length](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-heading-closing-sequence-length.html) | enforce consistent length for the closing sequence (trailing #s) in ATX headings. | 🔧 | |
118
+ | [markdown-preferences/atx-heading-closing-sequence](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-heading-closing-sequence.html) | enforce consistent use of closing sequence in ATX headings. | 🔧 | |
119
119
  | [markdown-preferences/blockquote-marker-alignment](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/blockquote-marker-alignment.html) | enforce consistent alignment of blockquote markers | 🔧 | ⭐ |
120
+ | [markdown-preferences/bullet-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/bullet-list-marker-style.html) | enforce consistent bullet list (unordered list) marker style | 🔧 | |
120
121
  | [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 | 🔧 | |
121
122
  | [markdown-preferences/hard-linebreak-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html) | enforce consistent hard linebreak style. | 🔧 | ⭐ |
123
+ | [markdown-preferences/level1-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level1-heading-style.html) | enforce consistent style for level 1 headings | 🔧 | |
124
+ | [markdown-preferences/level2-heading-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level2-heading-style.html) | enforce consistent style for level 2 headings | 🔧 | |
122
125
  | [markdown-preferences/list-marker-alignment](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/list-marker-alignment.html) | enforce consistent alignment of list markers | 🔧 | ⭐ |
123
126
  | [markdown-preferences/no-laziness-blockquotes](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-laziness-blockquotes.html) | disallow laziness in blockquotes | | ⭐ |
124
127
  | [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. | 🔧 | |
125
128
  | [markdown-preferences/no-text-backslash-linebreak](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html) | disallow text backslash at the end of a line. | | ⭐ |
126
129
  | [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. | 🔧 | |
127
130
  | [markdown-preferences/ordered-list-marker-sequence](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-sequence.html) | enforce that ordered list markers use sequential numbers | 🔧 | |
131
+ | [markdown-preferences/ordered-list-marker-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-style.html) | enforce consistent ordered list marker style | 🔧 | |
128
132
  | [markdown-preferences/padding-line-between-blocks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padding-line-between-blocks.html) | require or disallow padding lines between blocks | 🔧 | ⭐ |
129
133
  | [markdown-preferences/prefer-autolinks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-autolinks.html) | enforce the use of autolinks for URLs | 🔧 | ⭐ |
130
134
  | [markdown-preferences/prefer-fenced-code-blocks](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-fenced-code-blocks.html) | enforce the use of fenced code blocks over indented code blocks | 🔧 | ⭐ |
131
135
  | [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 | 🔧 | |
136
+ | [markdown-preferences/setext-heading-underline-length](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/setext-heading-underline-length.html) | enforce setext heading underline length | 🔧 | |
132
137
  | [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 | 🔧 | |
138
+ | [markdown-preferences/thematic-break-character-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-character-style.html) | enforce consistent character style for thematic breaks (horizontal rules) in Markdown. | 🔧 | |
139
+ | [markdown-preferences/thematic-break-length](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-length.html) | enforce consistent length for thematic breaks (horizontal rules) in Markdown. | 🔧 | |
140
+ | [markdown-preferences/thematic-break-sequence-pattern](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-sequence-pattern.html) | enforce consistent repeating patterns for thematic breaks (horizontal rules) in Markdown. | 🔧 | |
133
141
 
134
142
  <!-- prettier-ignore-end -->
135
143
 
package/lib/index.d.ts CHANGED
@@ -12,19 +12,24 @@ declare module 'eslint' {
12
12
  interface RuleOptions {
13
13
  /**
14
14
  * enforce consistent use of closing sequence in ATX headings.
15
- * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-headings-closing-sequence.html
15
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-heading-closing-sequence.html
16
16
  */
17
- 'markdown-preferences/atx-headings-closing-sequence'?: Linter.RuleEntry<MarkdownPreferencesAtxHeadingsClosingSequence>;
17
+ 'markdown-preferences/atx-heading-closing-sequence'?: Linter.RuleEntry<MarkdownPreferencesAtxHeadingClosingSequence>;
18
18
  /**
19
19
  * enforce consistent length for the closing sequence (trailing #s) in ATX headings.
20
- * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-headings-closing-sequence-length.html
20
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/atx-heading-closing-sequence-length.html
21
21
  */
22
- 'markdown-preferences/atx-headings-closing-sequence-length'?: Linter.RuleEntry<MarkdownPreferencesAtxHeadingsClosingSequenceLength>;
22
+ 'markdown-preferences/atx-heading-closing-sequence-length'?: Linter.RuleEntry<MarkdownPreferencesAtxHeadingClosingSequenceLength>;
23
23
  /**
24
24
  * enforce consistent alignment of blockquote markers
25
25
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/blockquote-marker-alignment.html
26
26
  */
27
27
  'markdown-preferences/blockquote-marker-alignment'?: Linter.RuleEntry<[]>;
28
+ /**
29
+ * enforce consistent bullet list (unordered list) marker style
30
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/bullet-list-marker-style.html
31
+ */
32
+ 'markdown-preferences/bullet-list-marker-style'?: Linter.RuleEntry<MarkdownPreferencesBulletListMarkerStyle>;
28
33
  /**
29
34
  * enforce canonical language names in code blocks
30
35
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/canonical-code-block-language.html
@@ -50,6 +55,16 @@ interface RuleOptions {
50
55
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/heading-casing.html
51
56
  */
52
57
  'markdown-preferences/heading-casing'?: Linter.RuleEntry<MarkdownPreferencesHeadingCasing>;
58
+ /**
59
+ * enforce consistent style for level 1 headings
60
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level1-heading-style.html
61
+ */
62
+ 'markdown-preferences/level1-heading-style'?: Linter.RuleEntry<MarkdownPreferencesLevel1HeadingStyle>;
63
+ /**
64
+ * enforce consistent style for level 2 headings
65
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/level2-heading-style.html
66
+ */
67
+ 'markdown-preferences/level2-heading-style'?: Linter.RuleEntry<MarkdownPreferencesLevel2HeadingStyle>;
53
68
  /**
54
69
  * enforce consistent alignment of list markers
55
70
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/list-marker-alignment.html
@@ -85,6 +100,11 @@ interface RuleOptions {
85
100
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-start.html
86
101
  */
87
102
  'markdown-preferences/ordered-list-marker-start'?: Linter.RuleEntry<MarkdownPreferencesOrderedListMarkerStart>;
103
+ /**
104
+ * enforce consistent ordered list marker style
105
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ordered-list-marker-style.html
106
+ */
107
+ 'markdown-preferences/ordered-list-marker-style'?: Linter.RuleEntry<MarkdownPreferencesOrderedListMarkerStyle>;
88
108
  /**
89
109
  * require or disallow padding lines between blocks
90
110
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/padding-line-between-blocks.html
@@ -115,6 +135,11 @@ interface RuleOptions {
115
135
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html
116
136
  */
117
137
  'markdown-preferences/prefer-linked-words'?: Linter.RuleEntry<MarkdownPreferencesPreferLinkedWords>;
138
+ /**
139
+ * enforce setext heading underline length
140
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/setext-heading-underline-length.html
141
+ */
142
+ 'markdown-preferences/setext-heading-underline-length'?: Linter.RuleEntry<MarkdownPreferencesSetextHeadingUnderlineLength>;
118
143
  /**
119
144
  * enforce a specific order for link definitions and footnote definitions
120
145
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/sort-definitions.html
@@ -125,14 +150,39 @@ interface RuleOptions {
125
150
  * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/table-header-casing.html
126
151
  */
127
152
  'markdown-preferences/table-header-casing'?: Linter.RuleEntry<MarkdownPreferencesTableHeaderCasing>;
153
+ /**
154
+ * enforce consistent character style for thematic breaks (horizontal rules) in Markdown.
155
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-character-style.html
156
+ */
157
+ 'markdown-preferences/thematic-break-character-style'?: Linter.RuleEntry<MarkdownPreferencesThematicBreakCharacterStyle>;
158
+ /**
159
+ * enforce consistent length for thematic breaks (horizontal rules) in Markdown.
160
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-length.html
161
+ */
162
+ 'markdown-preferences/thematic-break-length'?: Linter.RuleEntry<MarkdownPreferencesThematicBreakLength>;
163
+ /**
164
+ * enforce consistent repeating patterns for thematic breaks (horizontal rules) in Markdown.
165
+ * @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/thematic-break-sequence-pattern.html
166
+ */
167
+ 'markdown-preferences/thematic-break-sequence-pattern'?: Linter.RuleEntry<MarkdownPreferencesThematicBreakSequencePattern>;
128
168
  }
129
- type MarkdownPreferencesAtxHeadingsClosingSequence = [] | [{
169
+ type MarkdownPreferencesAtxHeadingClosingSequence = [] | [{
130
170
  closingSequence?: ("always" | "never");
131
171
  }];
132
- type MarkdownPreferencesAtxHeadingsClosingSequenceLength = [] | [{
172
+ type MarkdownPreferencesAtxHeadingClosingSequenceLength = [] | [{
133
173
  mode?: ("match-opening" | "length" | "consistent" | "consistent-line-length" | "fixed-line-length");
134
174
  length?: number;
135
175
  }];
176
+ type MarkdownPreferencesBulletListMarkerStyle = [] | [{
177
+ primary?: ("-" | "*" | "+");
178
+ secondary?: ("-" | "*" | "+" | "any");
179
+ overrides?: {
180
+ level?: number;
181
+ parentMarker?: ("-" | "*" | "+" | "any" | "ordered");
182
+ primary?: ("-" | "*" | "+");
183
+ secondary?: ("-" | "*" | "+" | "any");
184
+ }[];
185
+ }];
136
186
  type MarkdownPreferencesCanonicalCodeBlockLanguage = [] | [{
137
187
  languages?: {
138
188
  [k: string]: string;
@@ -152,6 +202,14 @@ type MarkdownPreferencesHeadingCasing = [] | [{
152
202
  ignorePatterns?: string[];
153
203
  minorWords?: string[];
154
204
  }];
205
+ type MarkdownPreferencesLevel1HeadingStyle = [] | [{
206
+ style?: ("atx" | "setext");
207
+ allowMultilineSetext?: boolean;
208
+ }];
209
+ type MarkdownPreferencesLevel2HeadingStyle = [] | [{
210
+ style?: ("atx" | "setext");
211
+ allowMultilineSetext?: boolean;
212
+ }];
155
213
  type MarkdownPreferencesListMarkerAlignment = [] | [{
156
214
  align?: ("left" | "right");
157
215
  }];
@@ -167,6 +225,14 @@ type MarkdownPreferencesNoTrailingSpaces = [] | [{
167
225
  type MarkdownPreferencesOrderedListMarkerStart = [] | [{
168
226
  start?: (1 | 0);
169
227
  }];
228
+ type MarkdownPreferencesOrderedListMarkerStyle = [] | [{
229
+ prefer?: ("n." | "n)");
230
+ overrides?: {
231
+ level?: number;
232
+ parentMarker?: ("n." | "n)" | "any" | "bullet");
233
+ prefer?: ("n." | "n)");
234
+ }[];
235
+ }];
170
236
  type MarkdownPreferencesPaddingLineBetweenBlocks = {
171
237
  prev: (("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*") | [("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*"), ...(("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*"))[]] | {
172
238
  type: (("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*") | [("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*"), ...(("blockquote" | "code" | "heading" | "html" | "list" | "paragraph" | "thematic-break" | "table" | "link-definition" | "footnote-definition" | "frontmatter" | "*"))[]]);
@@ -205,6 +271,11 @@ type MarkdownPreferencesPreferLinkedWords = [] | [{
205
271
  }[];
206
272
  [k: string]: unknown | undefined;
207
273
  }];
274
+ type MarkdownPreferencesSetextHeadingUnderlineLength = [] | [{
275
+ mode?: ("exact" | "minimum" | "consistent" | "consistent-line-length");
276
+ align?: ("any" | "exact" | "minimum" | "length");
277
+ length?: number;
278
+ }];
208
279
  type MarkdownPreferencesSortDefinitions = [] | [{
209
280
  order?: (string | [string, ...(string)[]] | {
210
281
  match: (string | [string, ...(string)[]]);
@@ -218,6 +289,15 @@ type MarkdownPreferencesTableHeaderCasing = [] | [{
218
289
  ignorePatterns?: string[];
219
290
  minorWords?: string[];
220
291
  }];
292
+ type MarkdownPreferencesThematicBreakCharacterStyle = [] | [{
293
+ style?: ("-" | "*" | "_");
294
+ }];
295
+ type MarkdownPreferencesThematicBreakLength = [] | [{
296
+ length?: number;
297
+ }];
298
+ type MarkdownPreferencesThematicBreakSequencePattern = [] | [{
299
+ pattern: (string | string | string);
300
+ }];
221
301
  declare namespace recommended_d_exports {
222
302
  export { files, language, languageOptions, name$1 as name, plugins, rules$1 as rules };
223
303
  }
@@ -236,7 +316,7 @@ declare namespace meta_d_exports {
236
316
  export { name, version };
237
317
  }
238
318
  declare const name: "eslint-plugin-markdown-preferences";
239
- declare const version: "0.16.0";
319
+ declare const version: "0.18.0";
240
320
  //#endregion
241
321
  //#region src/index.d.ts
242
322
  declare const configs: {