Skip to content

Commit 3a0886c

Browse files
authored
refactor: use CustomRuleDefinitionType in CSSRuleDefinition (#203)
1 parent 18cfbc1 commit 3a0886c

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
],
8585
"license": "Apache-2.0",
8686
"dependencies": {
87-
"@eslint/core": "^0.14.0",
87+
"@eslint/core": "^0.15.0",
8888
"@eslint/css-tree": "^3.6.1",
8989
"@eslint/plugin-kit": "^0.3.1"
9090
},

src/types.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
// Imports
88
//------------------------------------------------------------------------------
99

10-
import type { RuleVisitor, RuleDefinition } from "@eslint/core";
10+
import type {
11+
CustomRuleDefinitionType,
12+
CustomRuleTypeDefinitions,
13+
RuleVisitor,
14+
} from "@eslint/core";
1115

1216
import type { CssNodePlain, CssNodeNames } from "@eslint/css-tree";
1317

@@ -46,28 +50,19 @@ export interface CSSRuleVisitor
4650
extends RuleVisitor,
4751
Partial<WithExit<CSSNodeVisitor>> {}
4852

49-
export type CSSRuleDefinitionTypeOptions = {
50-
RuleOptions: unknown[];
51-
MessageIds: string;
52-
ExtRuleDocs: Record<string, unknown>;
53-
};
53+
export type CSSRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
5454

5555
/**
5656
* A rule definition for CSS.
5757
*/
5858
export type CSSRuleDefinition<
5959
Options extends Partial<CSSRuleDefinitionTypeOptions> = {},
60-
> = RuleDefinition<
61-
// Language specific type options (non-configurable)
60+
> = CustomRuleDefinitionType<
6261
{
6362
LangOptions: CSSLanguageOptions;
6463
Code: CSSSourceCode;
6564
Visitor: CSSRuleVisitor;
6665
Node: CssNodePlain;
67-
} & Required<
68-
// Rule specific type options (custom)
69-
Options &
70-
// Rule specific type options (defaults)
71-
Omit<CSSRuleDefinitionTypeOptions, keyof Options>
72-
>
66+
},
67+
Options
7368
>;

0 commit comments

Comments
 (0)