Skip to content

Commit 67f3d4e

Browse files
fix: remove redundant Comment member from CSSSyntaxElement union (eslint#119)
* fix(types): add missing `Comment` type import * chore: explicitly specify the `lib` TypeScript compiler option - Remove the default inherited type definitions from the project by aligning `lib` with `target`, making the type environment stricter, and verifying that the previous fix resolves the intended issue by surfacing related errors via the type tests. See: https://www.typescriptlang.org/tsconfig/#lib. * refactor: remove `Comment` from the `CSSSyntaxElement` union - The `CssNodePlain` type is a union that includes `Comment` as a member, making it redundant in the `CSSSyntaxElement` union.
1 parent fa391df commit 67f3d4e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type WithExit<RuleVisitorType extends RuleVisitor> = {
3131
/**
3232
* A CSS syntax element, including nodes and comments.
3333
*/
34-
export type CSSSyntaxElement = CssNodePlain | Comment;
34+
export type CSSSyntaxElement = CssNodePlain;
3535

3636
type CSSNodeVisitor = {
3737
[Type in CssNodeNames]: (

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"checkJs": true,
88
"outDir": "dist/esm",
99
"target": "ES2022",
10+
"lib": ["ES2022"],
1011
"moduleResolution": "NodeNext",
1112
"module": "NodeNext"
1213
}

0 commit comments

Comments
 (0)