|
1 | | -import markdown, { |
2 | | - MarkdownSourceCode, |
| 1 | +import markdown, { MarkdownSourceCode } from "@eslint/markdown"; |
| 2 | +import type { SourceLocation, SourceRange } from "@eslint/core"; |
| 3 | +import type { |
3 | 4 | MarkdownRuleDefinition, |
4 | 5 | MarkdownRuleVisitor, |
5 | | - type RuleModule, |
6 | | -} from "@eslint/markdown"; |
7 | | -import type { SourceLocation, SourceRange } from "@eslint/core"; |
8 | | -import type { Toml, Json } from "@eslint/markdown/types"; |
| 6 | + Toml, |
| 7 | + Json, |
| 8 | +} from "@eslint/markdown/types"; |
9 | 9 | import { ESLint, Linter } from "eslint"; |
10 | 10 | import type { |
11 | 11 | // Nodes (abstract) |
@@ -77,7 +77,7 @@ typeof processorPlugins satisfies {}; |
77 | 77 | null as AssertAllNamesIn<RecommendedRuleName, RuleName>; |
78 | 78 | } |
79 | 79 |
|
80 | | -(): RuleModule => ({ |
| 80 | +(): MarkdownRuleDefinition => ({ |
81 | 81 | create({ sourceCode }): MarkdownRuleVisitor { |
82 | 82 | sourceCode satisfies MarkdownSourceCode; |
83 | 83 | sourceCode.ast satisfies Root; |
@@ -172,16 +172,11 @@ typeof processorPlugins satisfies {}; |
172 | 172 | }, |
173 | 173 | }); |
174 | 174 |
|
175 | | -// All options optional - MarkdownRuleDefinition, MarkdownRuleDefinition<{}> and RuleModule |
| 175 | +// All options optional - MarkdownRuleDefinition and MarkdownRuleDefinition<{}> |
176 | 176 | // should be the same type. |
177 | | -( |
178 | | - rule1: MarkdownRuleDefinition, |
179 | | - rule2: MarkdownRuleDefinition<{}>, |
180 | | - rule3: RuleModule, |
181 | | -) => { |
182 | | - rule1 satisfies typeof rule2 satisfies typeof rule3; |
183 | | - rule2 satisfies typeof rule1 satisfies typeof rule3; |
184 | | - rule3 satisfies typeof rule1 satisfies typeof rule2; |
| 177 | +(rule1: MarkdownRuleDefinition, rule2: MarkdownRuleDefinition<{}>) => { |
| 178 | + rule1 satisfies typeof rule2; |
| 179 | + rule2 satisfies typeof rule1; |
185 | 180 | }; |
186 | 181 |
|
187 | 182 | // Type restrictions should be enforced |
|
0 commit comments