Skip to content

Commit 2d265ea

Browse files
chore: bring in types from jsonc-eslint-parser (#271)
1 parent baa030c commit 2d265ea

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

lib/types.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
import type { JSONSchema4 } from "json-schema";
22
import type { Rule } from "eslint";
3-
import type { AST } from "jsonc-eslint-parser";
3+
import type { RuleListener } from "jsonc-eslint-parser";
44

5-
export type RuleFunction<Node extends AST.JSONNode = never> = (
6-
node: Node,
7-
) => void;
8-
9-
export type BuiltInRuleListeners = {
10-
[Node in AST.JSONNode as Node["type"]]?: RuleFunction<Node>;
11-
};
12-
13-
export type BuiltInRuleListenerExits = {
14-
[Node in AST.JSONNode as `${Node["type"]}:exit`]?: RuleFunction<Node>;
15-
};
16-
17-
export interface RuleListener
18-
extends BuiltInRuleListeners,
19-
BuiltInRuleListenerExits {
20-
[key: string]: RuleFunction | undefined;
21-
}
5+
export { RuleListener };
226

237
export interface RuleModule {
248
meta: RuleMetaData;

lib/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function createRule(
2626
},
2727
},
2828
jsoncDefineRule: rule,
29-
create(context: Rule.RuleContext): any {
29+
create(context: Rule.RuleContext) {
3030
const sourceCode = getSourceCode(context);
3131
if (
3232
typeof sourceCode.parserServices.defineCustomBlocksVisitor ===

0 commit comments

Comments
 (0)