eslint-markdown 0.0.0-canary.0 → 0.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.
Files changed (82) hide show
  1. package/README.md +46 -0
  2. package/build/configs/all.d.ts +37 -0
  3. package/build/configs/base.d.ts +18 -0
  4. package/build/configs/index.d.ts +5 -0
  5. package/build/configs/recommended.d.ts +27 -0
  6. package/build/configs/stylistic.d.ts +24 -0
  7. package/build/core/ast/html.d.ts +11 -0
  8. package/build/core/ast/index.d.ts +3 -0
  9. package/build/core/ast/skip-ranges.d.ts +23 -0
  10. package/build/core/constants.d.ts +5 -0
  11. package/build/core/tests/get-file-name.d.ts +6 -0
  12. package/build/core/tests/index.d.ts +3 -0
  13. package/build/core/tests/rule-tester.d.ts +13 -0
  14. package/build/core/types.d.ts +14 -0
  15. package/build/index.d.ts +17 -0
  16. package/build/rules/allow-heading.d.ts +141 -0
  17. package/build/rules/allow-image-url.d.ts +70 -0
  18. package/build/rules/allow-link-url.d.ts +70 -0
  19. package/build/rules/code-lang-shorthand.d.ts +55 -0
  20. package/build/rules/consistent-delete-style.d.ts +43 -0
  21. package/build/rules/consistent-emphasis-style.d.ts +43 -0
  22. package/build/rules/consistent-strong-style.d.ts +43 -0
  23. package/build/rules/consistent-thematic-break-style.d.ts +43 -0
  24. package/build/rules/en-capitalization.d.ts +51 -0
  25. package/build/rules/endline-punctuation.d.ts +1 -0
  26. package/build/rules/footnote-order.d.ts +1 -0
  27. package/build/rules/glossary.d.ts +1 -0
  28. package/build/rules/heading-id.d.ts +65 -0
  29. package/build/rules/index.d.ts +20 -0
  30. package/build/rules/no-bold-paragraph.d.ts +28 -0
  31. package/build/rules/no-control-character.d.ts +49 -0
  32. package/build/rules/no-curly-quote.d.ts +58 -0
  33. package/build/rules/no-double-space.d.ts +44 -0
  34. package/build/rules/no-emoji.d.ts +28 -0
  35. package/build/rules/no-git-conflict-marker.d.ts +43 -0
  36. package/build/rules/no-irregular-dash.d.ts +49 -0
  37. package/build/rules/no-irregular-whitespace.d.ts +49 -0
  38. package/build/rules/no-unmatched-pair.d.ts +1 -0
  39. package/build/rules/no-url-trailing-slash.d.ts +32 -0
  40. package/build/rules/require-image-title.d.ts +51 -0
  41. package/build/rules/require-link-title.d.ts +51 -0
  42. package/package.json +76 -4
  43. package/src/configs/all.js +60 -0
  44. package/src/configs/base.js +41 -0
  45. package/src/configs/index.js +8 -0
  46. package/src/configs/recommended.js +50 -0
  47. package/src/configs/stylistic.js +47 -0
  48. package/src/core/ast/html.js +53 -0
  49. package/src/core/ast/index.js +4 -0
  50. package/src/core/ast/skip-ranges.js +51 -0
  51. package/src/core/constants.js +27 -0
  52. package/src/core/tests/get-file-name.js +23 -0
  53. package/src/core/tests/index.js +6 -0
  54. package/src/core/tests/rule-tester.js +127 -0
  55. package/src/core/types.ts +30 -0
  56. package/src/index.js +54 -0
  57. package/src/rules/allow-heading.js +193 -0
  58. package/src/rules/allow-image-url.js +191 -0
  59. package/src/rules/allow-link-url.js +191 -0
  60. package/src/rules/code-lang-shorthand.js +225 -0
  61. package/src/rules/consistent-delete-style.js +118 -0
  62. package/src/rules/consistent-emphasis-style.js +118 -0
  63. package/src/rules/consistent-strong-style.js +115 -0
  64. package/src/rules/consistent-thematic-break-style.js +103 -0
  65. package/src/rules/en-capitalization.js +162 -0
  66. package/src/rules/footnote-order.js +2 -0
  67. package/src/rules/glossary.js +6 -0
  68. package/src/rules/heading-id.js +153 -0
  69. package/src/rules/index.js +49 -0
  70. package/src/rules/no-bold-paragraph.js +72 -0
  71. package/src/rules/no-control-character.js +119 -0
  72. package/src/rules/no-curly-quote.js +144 -0
  73. package/src/rules/no-double-space.js +111 -0
  74. package/src/rules/no-emoji.js +77 -0
  75. package/src/rules/no-git-conflict-marker.js +111 -0
  76. package/src/rules/no-irregular-dash.js +119 -0
  77. package/src/rules/no-irregular-whitespace.js +120 -0
  78. package/src/rules/no-unmatched-pair.js +1 -0
  79. package/src/rules/no-url-trailing-slash.js +169 -0
  80. package/src/rules/require-image-title.js +145 -0
  81. package/src/rules/require-link-title.js +150 -0
  82. /package/{index.js → src/rules/endline-punctuation.js} +0 -0
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # eslint-markdown
2
+
3
+ [![lint](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-eslint-markdown/lint.yml?label=lint&color=6358d4&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-eslint-markdown/actions/workflows/lint.yml)
4
+ [![test](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-eslint-markdown/test.yml?label=test&color=6358d4&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-eslint-markdown/actions/workflows/test.yml)
5
+ [![test-cross-platform](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-eslint-markdown/test-cross-platform.yml?label=test-cross-platform&color=6358d4&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-eslint-markdown/actions/workflows/test-cross-platform.yml)
6
+ [![codecov](https://img.shields.io/codecov/c/gh/lumirlumir/npm-eslint-markdown?token=LJMUst9eR3&label=Codecov&color=6358d4&labelColor=333333&logo=codecov)](https://codecov.io/gh/lumirlumir/npm-eslint-markdown)
7
+ ![Node Current](https://img.shields.io/node/v/eslint-markdown?color=6358d4&labelColor=333333&logo=node.js)
8
+
9
+ [![npm package eslint-markdown latest version](https://img.shields.io/npm/v/eslint-markdown?label=eslint-markdown@latest&color=6358d4&labelColor=333333&logo=npm)](https://www.npmjs.com/package/eslint-markdown)
10
+ [![npm package eslint-markdown next version](https://img.shields.io/npm/v/eslint-markdown/next?label=eslint-markdown@next&color=6358d4&labelColor=333333&logo=npm)](https://www.npmjs.com/package/eslint-markdown)
11
+
12
+ > [!IMPORTANT]
13
+ >
14
+ > If you like this package, please give it a star on [GitHub](https://github.com/lumirlumir/npm-eslint-markdown)!⭐<br/>
15
+ > Your support helps us improve and maintain the project.
16
+
17
+ Lint your Markdown with ESLint.🛠️
18
+
19
+ ## Documentation
20
+
21
+ For full documentation, see the [official documentation of the `eslint-markdown`](https://eslint-markdown.lumir.page).
22
+
23
+ - [Installation](https://eslint-markdown.lumir.page/docs/get-started/installation)
24
+ - [Configurations](https://eslint-markdown.lumir.page/docs/get-started/configurations)
25
+ - [Migration Guide](https://eslint-markdown.lumir.page/docs/get-started/migration)
26
+ - [Rules](https://eslint-markdown.lumir.page/docs/rules)
27
+
28
+ ## Code of Conduct
29
+
30
+ See [Code of Conduct](https://github.com/lumirlumir/.github/blob/main/CODE_OF_CONDUCT.md#contributor-covenant-code-of-conduct).
31
+
32
+ ## Change Log
33
+
34
+ See [Change Log](https://github.com/lumirlumir/npm-eslint-markdown/blob/main/CHANGELOG.md).
35
+
36
+ ## Versioning
37
+
38
+ See [Versioning](https://eslint-markdown.lumir.page/docs/get-started/versioning).
39
+
40
+ ## Security
41
+
42
+ See [Security](https://github.com/lumirlumir/.github/blob/main/SECURITY.md#security).
43
+
44
+ ## License
45
+
46
+ [MIT](https://github.com/lumirlumir/npm-eslint-markdown/blob/main/LICENSE.md)
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @import { ESLint, Linter } from "eslint";
3
+ */
4
+ /** @param {ESLint.Plugin} plugin */
5
+ export default function all(plugin: ESLint.Plugin): {
6
+ readonly name: "md/all";
7
+ readonly files: ["**/*.md"];
8
+ readonly plugins: {
9
+ readonly markdown: typeof markdown;
10
+ readonly md: import("@eslint/core", { with: { "resolution-mode": "require" } }).Plugin;
11
+ };
12
+ readonly languageOptions: {
13
+ readonly frontmatter: "yaml";
14
+ };
15
+ readonly language: "markdown/gfm";
16
+ readonly rules: {
17
+ readonly 'md/allow-image-url': "error";
18
+ readonly 'md/allow-link-url': "error";
19
+ readonly 'md/code-lang-shorthand': "error";
20
+ readonly 'md/consistent-delete-style': "error";
21
+ readonly 'md/consistent-emphasis-style': "error";
22
+ readonly 'md/consistent-strong-style': "error";
23
+ readonly 'md/consistent-thematic-break-style': "error";
24
+ readonly 'md/no-control-character': "error";
25
+ readonly 'md/no-curly-quote': "error";
26
+ readonly 'md/no-double-space': "error";
27
+ readonly 'md/no-emoji': "error";
28
+ readonly 'md/no-git-conflict-marker': "error";
29
+ readonly 'md/no-irregular-dash': "error";
30
+ readonly 'md/no-irregular-whitespace': "error";
31
+ readonly 'md/no-url-trailing-slash': "error";
32
+ readonly 'md/require-image-title': "error";
33
+ readonly 'md/require-link-title': "error";
34
+ };
35
+ };
36
+ import type { ESLint } from "eslint";
37
+ import markdown from '@eslint/markdown';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @import { ESLint, Linter } from "eslint";
3
+ */
4
+ /** @param {ESLint.Plugin} plugin */
5
+ export default function base(plugin: ESLint.Plugin): {
6
+ readonly name: "md/base";
7
+ readonly files: ["**/*.md"];
8
+ readonly plugins: {
9
+ readonly markdown: typeof markdown;
10
+ readonly md: import("@eslint/core", { with: { "resolution-mode": "require" } }).Plugin;
11
+ };
12
+ readonly languageOptions: {
13
+ readonly frontmatter: "yaml";
14
+ };
15
+ readonly language: "markdown/gfm";
16
+ };
17
+ import type { ESLint } from "eslint";
18
+ import markdown from '@eslint/markdown';
@@ -0,0 +1,5 @@
1
+ import all from './all.js';
2
+ import base from './base.js';
3
+ import recommended from './recommended.js';
4
+ import stylistic from './stylistic.js';
5
+ export { all, base, recommended, stylistic };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @import { ESLint, Linter } from "eslint";
3
+ */
4
+ /** @param {ESLint.Plugin} plugin */
5
+ export default function recommended(plugin: ESLint.Plugin): {
6
+ readonly name: "md/recommended";
7
+ readonly files: ["**/*.md"];
8
+ readonly plugins: {
9
+ readonly markdown: typeof markdown;
10
+ readonly md: import("@eslint/core", { with: { "resolution-mode": "require" } }).Plugin;
11
+ };
12
+ readonly languageOptions: {
13
+ readonly frontmatter: "yaml";
14
+ };
15
+ readonly language: "markdown/gfm";
16
+ readonly rules: {
17
+ readonly 'md/code-lang-shorthand': "error";
18
+ readonly 'md/no-control-character': "error";
19
+ readonly 'md/no-curly-quote': "error";
20
+ readonly 'md/no-double-space': "error";
21
+ readonly 'md/no-git-conflict-marker': "error";
22
+ readonly 'md/no-irregular-dash': "error";
23
+ readonly 'md/no-irregular-whitespace': "error";
24
+ };
25
+ };
26
+ import type { ESLint } from "eslint";
27
+ import markdown from '@eslint/markdown';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @import { ESLint, Linter } from "eslint";
3
+ */
4
+ /** @param {ESLint.Plugin} plugin */
5
+ export default function stylistic(plugin: ESLint.Plugin): {
6
+ readonly name: "md/stylistic";
7
+ readonly files: ["**/*.md"];
8
+ readonly plugins: {
9
+ readonly markdown: typeof markdown;
10
+ readonly md: import("@eslint/core", { with: { "resolution-mode": "require" } }).Plugin;
11
+ };
12
+ readonly languageOptions: {
13
+ readonly frontmatter: "yaml";
14
+ };
15
+ readonly language: "markdown/gfm";
16
+ readonly rules: {
17
+ readonly 'md/consistent-delete-style': "error";
18
+ readonly 'md/consistent-emphasis-style': "error";
19
+ readonly 'md/consistent-strong-style': "error";
20
+ readonly 'md/consistent-thematic-break-style': "error";
21
+ };
22
+ };
23
+ import type { ESLint } from "eslint";
24
+ import markdown from '@eslint/markdown';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @import { DefaultTreeAdapterTypes } from 'parse5';
3
+ */
4
+ /**
5
+ * Mimics the behavior of `getElementsByTagName` in the DOM API.
6
+ * @param {string} html The HTML string to parse.
7
+ * @param {string} tagName The tag name to search for (case-insensitive).
8
+ * @returns {Array<DefaultTreeAdapterTypes.Element | DefaultTreeAdapterTypes.Template>}
9
+ */
10
+ export default function getElementsByTagName(html: string, tagName: string): Array<DefaultTreeAdapterTypes.Element | DefaultTreeAdapterTypes.Template>;
11
+ import type { DefaultTreeAdapterTypes } from 'parse5';
@@ -0,0 +1,3 @@
1
+ import getElementsByTagName from './html.js';
2
+ import SkipRanges from './skip-ranges.js';
3
+ export { getElementsByTagName, SkipRanges };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Class to manage skip ranges.
3
+ */
4
+ /**
5
+ * @import { SourceRange } from '@eslint/core';
6
+ */
7
+ /**
8
+ * Class to manage skip ranges.
9
+ */
10
+ export default class SkipRanges {
11
+ /**
12
+ * Push a `range` to the set of skip ranges. (Method chaining supported.)
13
+ * @param {SourceRange} range
14
+ */
15
+ push(range: SourceRange): this;
16
+ /**
17
+ * Check whether the `offset` is included in any skip ranges.
18
+ * @param {number} offset
19
+ */
20
+ includes(offset: number): boolean;
21
+ #private;
22
+ }
23
+ import type { SourceRange } from '@eslint/core';
@@ -0,0 +1,5 @@
1
+ /** @satisfies {string} */
2
+ export const PKG_NAME: "eslint-markdown";
3
+ /** @satisfies {string} */
4
+ export const PKG_VERSION: string;
5
+ export function URL_RULE_DOCS(ruleName?: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the file name of the module.
3
+ * @param {string} importMetaUrl The absolute `file:` URL of the module.
4
+ * @returns {string} The file name of the module.
5
+ */
6
+ export default function getFileName(importMetaUrl: string): string;
@@ -0,0 +1,3 @@
1
+ import getFileName from './get-file-name.js';
2
+ import ruleTester from './rule-tester.js';
3
+ export { getFileName, ruleTester };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Markdown rule tester.
3
+ * @param {string} ruleName Rule name.
4
+ * @param {RuleModule<RuleOptions, MessageIds>} rule Rule module.
5
+ * @param {Tests} tests Tests.
6
+ */
7
+ export default function ruleTester(ruleName: string, rule: RuleModule<RuleOptions, MessageIds>, tests: Tests): void;
8
+ export type RuleOptions = MarkdownRuleDefinitionTypeOptions["RuleOptions"];
9
+ export type MessageIds = MarkdownRuleDefinitionTypeOptions["MessageIds"];
10
+ export type Tests = Parameters<RuleTester["run"]>[2];
11
+ import type { RuleModule } from '../types.js';
12
+ import type { MarkdownRuleDefinitionTypeOptions } from '@eslint/markdown';
13
+ import { RuleTester } from 'eslint';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @fileoverview Define common types.
3
+ */
4
+ import type { MarkdownRuleDefinition, MarkdownRuleDefinitionTypeOptions } from '@eslint/markdown';
5
+ export type RuleModule<RuleOptions extends MarkdownRuleDefinitionTypeOptions['RuleOptions'], MessageIds extends MarkdownRuleDefinitionTypeOptions['MessageIds']> = MarkdownRuleDefinition<{
6
+ RuleOptions: RuleOptions;
7
+ MessageIds: MessageIds;
8
+ ExtRuleDocs: Partial<{
9
+ /**
10
+ * Indicates whether this rule is part of the stylistic configuration.
11
+ */
12
+ stylistic: boolean;
13
+ }>;
14
+ }>;
@@ -0,0 +1,17 @@
1
+ export default plugin;
2
+ declare namespace plugin {
3
+ export namespace meta {
4
+ export { name };
5
+ export { version };
6
+ }
7
+ export { rules };
8
+ export namespace configs {
9
+ const all: ReturnType<typeof import("./configs/all.js").default>;
10
+ const base: ReturnType<typeof import("./configs/base.js").default>;
11
+ const recommended: ReturnType<typeof import("./configs/recommended.js").default>;
12
+ const stylistic: ReturnType<typeof import("./configs/stylistic.js").default>;
13
+ }
14
+ }
15
+ import { PKG_NAME as name } from './core/constants.js';
16
+ import { PKG_VERSION as version } from './core/constants.js';
17
+ import rules from './rules/index.js';
@@ -0,0 +1,141 @@
1
+ declare const _default: {
2
+ meta: {
3
+ type: "problem";
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ recommended: boolean;
8
+ stylistic: false;
9
+ };
10
+ schema: {
11
+ type: "object";
12
+ properties: {
13
+ h1: {
14
+ oneOf: ({
15
+ enum: false[];
16
+ type?: never;
17
+ items?: never;
18
+ uniqueItems?: never;
19
+ } | {
20
+ type: "array";
21
+ items: {
22
+ type: "string";
23
+ };
24
+ uniqueItems: true;
25
+ enum?: never;
26
+ })[];
27
+ };
28
+ h2: {
29
+ oneOf: ({
30
+ enum: false[];
31
+ type?: never;
32
+ items?: never;
33
+ uniqueItems?: never;
34
+ } | {
35
+ type: "array";
36
+ items: {
37
+ type: "string";
38
+ };
39
+ uniqueItems: true;
40
+ enum?: never;
41
+ })[];
42
+ };
43
+ h3: {
44
+ oneOf: ({
45
+ enum: false[];
46
+ type?: never;
47
+ items?: never;
48
+ uniqueItems?: never;
49
+ } | {
50
+ type: "array";
51
+ items: {
52
+ type: "string";
53
+ };
54
+ uniqueItems: true;
55
+ enum?: never;
56
+ })[];
57
+ };
58
+ h4: {
59
+ oneOf: ({
60
+ enum: false[];
61
+ type?: never;
62
+ items?: never;
63
+ uniqueItems?: never;
64
+ } | {
65
+ type: "array";
66
+ items: {
67
+ type: "string";
68
+ };
69
+ uniqueItems: true;
70
+ enum?: never;
71
+ })[];
72
+ };
73
+ h5: {
74
+ oneOf: ({
75
+ enum: false[];
76
+ type?: never;
77
+ items?: never;
78
+ uniqueItems?: never;
79
+ } | {
80
+ type: "array";
81
+ items: {
82
+ type: "string";
83
+ };
84
+ uniqueItems: true;
85
+ enum?: never;
86
+ })[];
87
+ };
88
+ h6: {
89
+ oneOf: ({
90
+ enum: false[];
91
+ type?: never;
92
+ items?: never;
93
+ uniqueItems?: never;
94
+ } | {
95
+ type: "array";
96
+ items: {
97
+ type: "string";
98
+ };
99
+ uniqueItems: true;
100
+ enum?: never;
101
+ })[];
102
+ };
103
+ };
104
+ additionalProperties: false;
105
+ }[];
106
+ defaultOptions: [{
107
+ h1: false;
108
+ h2: false;
109
+ h3: false;
110
+ h4: false;
111
+ h5: false;
112
+ h6: false;
113
+ }];
114
+ messages: {
115
+ allowHeading: string;
116
+ allowHeadingDepth: string;
117
+ };
118
+ language: string;
119
+ dialects: string[];
120
+ };
121
+ create(context: import("@eslint/core").RuleContext<{
122
+ LangOptions: import("@eslint/markdown").MarkdownLanguageOptions;
123
+ Code: import("@eslint/markdown").MarkdownSourceCode;
124
+ RuleOptions: RuleOptions;
125
+ Node: import("mdast").Node;
126
+ MessageIds: MessageIds;
127
+ }>): {
128
+ heading(node: import("mdast").Heading): void;
129
+ };
130
+ };
131
+ export default _default;
132
+ export type RuleOptions = [{
133
+ h1: HeadingOption;
134
+ h2: HeadingOption;
135
+ h3: HeadingOption;
136
+ h4: HeadingOption;
137
+ h5: HeadingOption;
138
+ h6: HeadingOption;
139
+ }];
140
+ export type MessageIds = "allowHeading" | "allowHeadingDepth";
141
+ export type HeadingOption = false | string[];
@@ -0,0 +1,70 @@
1
+ declare const _default: {
2
+ meta: {
3
+ type: "problem";
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ recommended: boolean;
8
+ stylistic: false;
9
+ };
10
+ schema: {
11
+ type: "object";
12
+ properties: {
13
+ allowUrls: {
14
+ type: "array";
15
+ items: {
16
+ type: "object";
17
+ };
18
+ uniqueItems: true;
19
+ };
20
+ disallowUrls: {
21
+ type: "array";
22
+ items: {
23
+ type: "object";
24
+ };
25
+ uniqueItems: true;
26
+ };
27
+ allowDefinitions: {
28
+ type: "array";
29
+ items: {
30
+ type: "string";
31
+ };
32
+ uniqueItems: true;
33
+ };
34
+ };
35
+ additionalProperties: false;
36
+ }[];
37
+ defaultOptions: [{
38
+ allowUrls: RegExp[];
39
+ disallowUrls: never[];
40
+ allowDefinitions: string[];
41
+ }];
42
+ messages: {
43
+ allowImageUrl: string;
44
+ disallowImageUrl: string;
45
+ };
46
+ language: string;
47
+ dialects: string[];
48
+ };
49
+ create(context: import("@eslint/core").RuleContext<{
50
+ LangOptions: import("@eslint/markdown").MarkdownLanguageOptions;
51
+ Code: import("@eslint/markdown").MarkdownSourceCode;
52
+ RuleOptions: RuleOptions;
53
+ Node: import("mdast").Node;
54
+ MessageIds: MessageIds;
55
+ }>): {
56
+ image(node: import("mdast").Image): void;
57
+ html(node: import("mdast").Html): void;
58
+ imageReference(node: import("mdast").ImageReference): void;
59
+ definition(node: Definition): void;
60
+ 'root:exit'(): void;
61
+ };
62
+ };
63
+ export default _default;
64
+ export type RuleOptions = [{
65
+ allowUrls: RegExp[];
66
+ disallowUrls: RegExp[];
67
+ allowDefinitions: string[];
68
+ }];
69
+ export type MessageIds = "allowImageUrl" | "disallowImageUrl";
70
+ import type { Definition } from 'mdast';
@@ -0,0 +1,70 @@
1
+ declare const _default: {
2
+ meta: {
3
+ type: "problem";
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ recommended: boolean;
8
+ stylistic: false;
9
+ };
10
+ schema: {
11
+ type: "object";
12
+ properties: {
13
+ allowUrls: {
14
+ type: "array";
15
+ items: {
16
+ type: "object";
17
+ };
18
+ uniqueItems: true;
19
+ };
20
+ disallowUrls: {
21
+ type: "array";
22
+ items: {
23
+ type: "object";
24
+ };
25
+ uniqueItems: true;
26
+ };
27
+ allowDefinitions: {
28
+ type: "array";
29
+ items: {
30
+ type: "string";
31
+ };
32
+ uniqueItems: true;
33
+ };
34
+ };
35
+ additionalProperties: false;
36
+ }[];
37
+ defaultOptions: [{
38
+ allowUrls: RegExp[];
39
+ disallowUrls: never[];
40
+ allowDefinitions: string[];
41
+ }];
42
+ messages: {
43
+ allowLinkUrl: string;
44
+ disallowLinkUrl: string;
45
+ };
46
+ language: string;
47
+ dialects: string[];
48
+ };
49
+ create(context: import("@eslint/core").RuleContext<{
50
+ LangOptions: import("@eslint/markdown").MarkdownLanguageOptions;
51
+ Code: import("@eslint/markdown").MarkdownSourceCode;
52
+ RuleOptions: RuleOptions;
53
+ Node: import("mdast").Node;
54
+ MessageIds: MessageIds;
55
+ }>): {
56
+ link(node: import("mdast").Link): void;
57
+ html(node: import("mdast").Html): void;
58
+ linkReference(node: import("mdast").LinkReference): void;
59
+ definition(node: Definition): void;
60
+ 'root:exit'(): void;
61
+ };
62
+ };
63
+ export default _default;
64
+ export type RuleOptions = [{
65
+ allowUrls: RegExp[];
66
+ disallowUrls: RegExp[];
67
+ allowDefinitions: string[];
68
+ }];
69
+ export type MessageIds = "allowLinkUrl" | "disallowLinkUrl";
70
+ import type { Definition } from 'mdast';
@@ -0,0 +1,55 @@
1
+ declare const _default: {
2
+ meta: {
3
+ type: "problem";
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ recommended: boolean;
8
+ stylistic: false;
9
+ };
10
+ fixable: "code";
11
+ schema: {
12
+ type: "object";
13
+ properties: {
14
+ allow: {
15
+ type: "array";
16
+ items: {
17
+ type: "string";
18
+ };
19
+ uniqueItems: true;
20
+ };
21
+ override: {
22
+ type: "object";
23
+ additionalProperties: {
24
+ type: "string";
25
+ };
26
+ };
27
+ };
28
+ additionalProperties: false;
29
+ }[];
30
+ defaultOptions: [{
31
+ allow: never[];
32
+ override: {};
33
+ }];
34
+ messages: {
35
+ codeLangShorthand: string;
36
+ };
37
+ language: string;
38
+ dialects: string[];
39
+ };
40
+ create(context: import("@eslint/core").RuleContext<{
41
+ LangOptions: import("@eslint/markdown").MarkdownLanguageOptions;
42
+ Code: import("@eslint/markdown").MarkdownSourceCode;
43
+ RuleOptions: RuleOptions;
44
+ Node: import("mdast").Node;
45
+ MessageIds: "codeLangShorthand";
46
+ }>): {
47
+ code(node: import("mdast").Code): void;
48
+ };
49
+ };
50
+ export default _default;
51
+ export type RuleOptions = [{
52
+ allow: string[];
53
+ override: Record<string, string>;
54
+ }];
55
+ export type MessageIds = "codeLangShorthand";
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ meta: {
3
+ type: "layout";
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ recommended: boolean;
8
+ stylistic: true;
9
+ };
10
+ fixable: "code";
11
+ schema: {
12
+ type: "object";
13
+ properties: {
14
+ style: {
15
+ enum: string[];
16
+ };
17
+ };
18
+ additionalProperties: false;
19
+ }[];
20
+ defaultOptions: [{
21
+ style: "consistent";
22
+ }];
23
+ messages: {
24
+ style: string;
25
+ };
26
+ language: string;
27
+ dialects: string[];
28
+ };
29
+ create(context: import("@eslint/core").RuleContext<{
30
+ LangOptions: import("@eslint/markdown").MarkdownLanguageOptions;
31
+ Code: import("@eslint/markdown").MarkdownSourceCode;
32
+ RuleOptions: RuleOptions;
33
+ Node: import("mdast").Node;
34
+ MessageIds: "style";
35
+ }>): {
36
+ delete(node: import("mdast").Delete): void;
37
+ };
38
+ };
39
+ export default _default;
40
+ export type RuleOptions = [{
41
+ style: "consistent" | "~" | "~~";
42
+ }];
43
+ export type MessageIds = "style";