diff --git a/package.json b/package.json index 28372acb..d09dbcab 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "yorkie": "^2.0.0" }, "dependencies": { - "@eslint/core": "^0.17.0", + "@eslint/core": "^1.1.0", "@eslint/plugin-kit": "^0.6.0", "github-slugger": "^2.0.0", "mdast-util-from-markdown": "^2.0.2", diff --git a/src/index.js b/src/index.js index fcfe99d2..f33e1fdf 100644 --- a/src/index.js +++ b/src/index.js @@ -25,7 +25,7 @@ import rules from "./build/rules.js"; // Exports //----------------------------------------------------------------------------- -/** @type {Linter.RulesRecord} */ +/** @satisfies {Linter.RulesRecord} */ const processorRulesConfig = { // The Markdown parser automatically trims trailing // newlines from code blocks. diff --git a/src/types.ts b/src/types.ts index 3499acf6..7f0e1481 100644 --- a/src/types.ts +++ b/src/types.ts @@ -39,25 +39,17 @@ import type { Yaml, } from "mdast"; import type { - CustomRuleDefinitionType, - CustomRuleTypeDefinitions, LanguageContext, LanguageOptions, RuleVisitor, } from "@eslint/core"; +import type { + CustomRuleDefinitionType, + CustomRuleTypeDefinitions, + CustomRuleVisitorWithExit, +} from "@eslint/plugin-kit"; import type { MarkdownSourceCode } from "./index.js"; -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** Adds matching `:exit` selectors for all properties of a `RuleVisitor`. */ -type WithExit = { - [Key in keyof RuleVisitorType as - | Key - | `${Key & string}:exit`]: RuleVisitorType[Key]; -}; - //------------------------------------------------------------------------------ // Exports //------------------------------------------------------------------------------ @@ -132,7 +124,7 @@ export type MarkdownLanguageContext = LanguageContext; export interface MarkdownRuleVisitor extends RuleVisitor, - WithExit< + CustomRuleVisitorWithExit< { root?(node: Root): void; } & { diff --git a/tests/types/types.test.ts b/tests/types/types.test.ts index f7aa43dd..6f423470 100644 --- a/tests/types/types.test.ts +++ b/tests/types/types.test.ts @@ -8,8 +8,8 @@ import type { RangeMap, Block, } from "@eslint/markdown"; -import type { SourceLocation, SourceRange } from "@eslint/core"; -import type { ESLint, Linter } from "eslint"; +import type { Plugin, SourceLocation, SourceRange } from "@eslint/core"; +import type { Linter } from "eslint"; import type { Position } from "unist"; import type { // Nodes (abstract) @@ -89,7 +89,7 @@ const invalidBlock: Block = { value: "code", }; -markdown satisfies ESLint.Plugin; +markdown satisfies Plugin; markdown.meta.name satisfies string; markdown.meta.version satisfies string;