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 @@ -84,7 +84,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@eslint/core": "^0.14.0",
"@eslint/core": "^0.15.0",
"@eslint/css-tree": "^3.6.1",
"@eslint/plugin-kit": "^0.3.1"
},
Expand Down
23 changes: 9 additions & 14 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
// Imports
//------------------------------------------------------------------------------

import type { RuleVisitor, RuleDefinition } from "@eslint/core";
import type {
CustomRuleDefinitionType,
CustomRuleTypeDefinitions,
RuleVisitor,
} from "@eslint/core";

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

Expand Down Expand Up @@ -46,28 +50,19 @@ export interface CSSRuleVisitor
extends RuleVisitor,
Partial<WithExit<CSSNodeVisitor>> {}

export type CSSRuleDefinitionTypeOptions = {
RuleOptions: unknown[];
MessageIds: string;
ExtRuleDocs: Record<string, unknown>;
};
export type CSSRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;

/**
* A rule definition for CSS.
*/
export type CSSRuleDefinition<
Options extends Partial<CSSRuleDefinitionTypeOptions> = {},
> = RuleDefinition<
// Language specific type options (non-configurable)
> = CustomRuleDefinitionType<
{
LangOptions: CSSLanguageOptions;
Code: CSSSourceCode;
Visitor: CSSRuleVisitor;
Node: CssNodePlain;
} & Required<
// Rule specific type options (custom)
Options &
// Rule specific type options (defaults)
Omit<CSSRuleDefinitionTypeOptions, keyof Options>
>
},
Options
>;
Loading