Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 6 additions & 14 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RuleVisitorType extends RuleVisitor> = {
[Key in keyof RuleVisitorType as
| Key
| `${Key & string}:exit`]: RuleVisitorType[Key];
};

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -132,7 +124,7 @@ export type MarkdownLanguageContext = LanguageContext<MarkdownLanguageOptions>;
export interface MarkdownRuleVisitor
extends
RuleVisitor,
WithExit<
CustomRuleVisitorWithExit<
{
root?(node: Root): void;
} & {
Expand Down
6 changes: 3 additions & 3 deletions tests/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down