eslint-markdown 0.14.1 → 0.16.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.
Files changed (43) hide show
  1. package/build/configs/all.d.ts +1 -0
  2. package/build/configs/all.js +1 -0
  3. package/build/configs/stylistic.d.ts +1 -0
  4. package/build/configs/stylistic.js +1 -0
  5. package/build/core/types.d.ts +15 -3
  6. package/build/index.d.ts +6 -1508
  7. package/build/index.js +3 -1
  8. package/build/rules/allow-heading.d.ts +1 -4
  9. package/build/rules/allow-image-url.d.ts +1 -4
  10. package/build/rules/allow-link-url.d.ts +1 -4
  11. package/build/rules/code-lang-shorthand.d.ts +1 -4
  12. package/build/rules/consistent-code-style.d.ts +1 -4
  13. package/build/rules/consistent-code-style.js +22 -6
  14. package/build/rules/consistent-delete-style.d.ts +1 -4
  15. package/build/rules/consistent-emphasis-style.d.ts +1 -4
  16. package/build/rules/consistent-heading-style.d.ts +55 -0
  17. package/build/rules/consistent-heading-style.js +290 -0
  18. package/build/rules/consistent-inline-code-style.d.ts +1 -4
  19. package/build/rules/consistent-strong-style.d.ts +1 -4
  20. package/build/rules/consistent-thematic-break-style.d.ts +1 -4
  21. package/build/rules/consistent-unordered-list-style.d.ts +1 -4
  22. package/build/rules/en-capitalization.d.ts +1 -4
  23. package/build/rules/index.d.ts +89 -106
  24. package/build/rules/index.js +2 -0
  25. package/build/rules/no-consecutive-blank-line.d.ts +1 -4
  26. package/build/rules/no-control-character.d.ts +1 -4
  27. package/build/rules/no-curly-quote.d.ts +1 -4
  28. package/build/rules/no-double-punctuation.d.ts +1 -4
  29. package/build/rules/no-double-space.d.ts +1 -4
  30. package/build/rules/no-emoji.d.ts +1 -4
  31. package/build/rules/no-git-conflict-marker.d.ts +11 -4
  32. package/build/rules/no-git-conflict-marker.js +9 -1
  33. package/build/rules/no-irregular-dash.d.ts +1 -4
  34. package/build/rules/no-irregular-whitespace.d.ts +21 -4
  35. package/build/rules/no-irregular-whitespace.js +17 -1
  36. package/build/rules/no-tab.d.ts +1 -4
  37. package/build/rules/no-trailing-heading-punctuation.d.ts +1 -4
  38. package/build/rules/no-url-trailing-slash.d.ts +1 -4
  39. package/build/rules/no-url-trailing-slash.js +2 -2
  40. package/build/rules/require-heading-id.d.ts +1 -4
  41. package/build/rules/require-image-title.d.ts +1 -4
  42. package/build/rules/require-link-title.d.ts +1 -4
  43. package/package.json +4 -3
@@ -23,6 +23,7 @@ export default function all(plugin: ESLint.Plugin): {
23
23
  readonly 'md/consistent-code-style': "error";
24
24
  readonly 'md/consistent-delete-style': "error";
25
25
  readonly 'md/consistent-emphasis-style': "error";
26
+ readonly 'md/consistent-heading-style': "error";
26
27
  readonly 'md/consistent-inline-code-style': "error";
27
28
  readonly 'md/consistent-strong-style': "error";
28
29
  readonly 'md/consistent-thematic-break-style': "error";
@@ -31,6 +31,7 @@ export default function all(plugin) {
31
31
  'md/consistent-code-style': 'error',
32
32
  'md/consistent-delete-style': 'error',
33
33
  'md/consistent-emphasis-style': 'error',
34
+ 'md/consistent-heading-style': 'error',
34
35
  'md/consistent-inline-code-style': 'error',
35
36
  'md/consistent-strong-style': 'error',
36
37
  'md/consistent-thematic-break-style': 'error',
@@ -19,6 +19,7 @@ export default function stylistic(plugin: ESLint.Plugin): {
19
19
  readonly 'md/consistent-code-style': "error";
20
20
  readonly 'md/consistent-delete-style': "error";
21
21
  readonly 'md/consistent-emphasis-style': "error";
22
+ readonly 'md/consistent-heading-style': "error";
22
23
  readonly 'md/consistent-inline-code-style': "error";
23
24
  readonly 'md/consistent-strong-style': "error";
24
25
  readonly 'md/consistent-thematic-break-style': "error";
@@ -27,6 +27,7 @@ export default function stylistic(plugin) {
27
27
  'md/consistent-code-style': 'error',
28
28
  'md/consistent-delete-style': 'error',
29
29
  'md/consistent-emphasis-style': 'error',
30
+ 'md/consistent-heading-style': 'error',
30
31
  'md/consistent-inline-code-style': 'error',
31
32
  'md/consistent-strong-style': 'error',
32
33
  'md/consistent-thematic-break-style': 'error',
@@ -1,13 +1,20 @@
1
1
  /**
2
2
  * @fileoverview Define common types.
3
3
  */
4
- import type { MarkdownRuleDefinition, MarkdownRuleDefinitionTypeOptions } from '@eslint/markdown';
4
+ import type { MarkdownRuleDefinition, MarkdownRuleDefinitionTypeOptions, MarkdownRuleVisitor } from '@eslint/markdown';
5
+ /**
6
+ * Keeps inferred context types nameable without exposing Markdown's internal types.
7
+ *
8
+ * NOTE: This type supports compatibility with ESLint v9 and v10.
9
+ * Reevaluate whether it is still needed when ESLint v9 support is dropped.
10
+ */
11
+ export type RuleContext<Options extends Partial<MarkdownRuleDefinitionTypeOptions>> = Omit<Parameters<MarkdownRuleDefinition<Options>['create']>[0], never>;
5
12
  /**
6
13
  * Represents a rule module with specific rule options and message IDs.
7
14
  * @template RuleOptions The rule options.
8
15
  * @template MessageIds The message IDs.
9
16
  */
10
- export type RuleModule<RuleOptions extends MarkdownRuleDefinitionTypeOptions['RuleOptions'], MessageIds extends MarkdownRuleDefinitionTypeOptions['MessageIds']> = MarkdownRuleDefinition<{
17
+ export interface RuleModule<RuleOptions extends MarkdownRuleDefinitionTypeOptions['RuleOptions'], MessageIds extends MarkdownRuleDefinitionTypeOptions['MessageIds']> extends MarkdownRuleDefinition<{
11
18
  RuleOptions: RuleOptions;
12
19
  MessageIds: MessageIds;
13
20
  ExtRuleDocs: Partial<{
@@ -16,4 +23,9 @@ export type RuleModule<RuleOptions extends MarkdownRuleDefinitionTypeOptions['Ru
16
23
  */
17
24
  stylistic: boolean;
18
25
  }>;
19
- }>;
26
+ }> {
27
+ create(context: RuleContext<{
28
+ RuleOptions: RuleOptions;
29
+ MessageIds: MessageIds;
30
+ }>): MarkdownRuleVisitor;
31
+ }