Skip to content

Commit 46c1f97

Browse files
authored
fix: improve type compatibility with eslint (#228)
* fix: improve type compatibility with eslint This change adjusts the `RuleFunction` generic type to default to `any` for the Node, instead of `never`. * add changeset
1 parent a6edd15 commit 46c1f97

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/sour-memes-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"jsonc-eslint-parser": patch
3+
---
4+
5+
improve type compatibility with eslint

src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export interface JSONParserOptions {
66
jsonSyntax?: JSONSyntax;
77
}
88

9-
export type RuleFunction<Node extends AST.JSONNode = never> = (
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- used for compatibility with ESLint types
10+
export type RuleFunction<Node extends AST.JSONNode = any> = (
1011
node: Node,
1112
) => void;
1213

0 commit comments

Comments
 (0)