-
-
Notifications
You must be signed in to change notification settings - Fork 20
fix: remove redundant Comment
member from CSSSyntaxElement
union
#119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove redundant Comment
member from CSSSyntaxElement
union
#119
Conversation
Hi @louis-young-slice!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
1 similar comment
Hi @louis-young-slice!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
Comment
type importComment
type import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for tracking this down. Is there a way to can automate checking this?
We have types.test.ts
for our type checking. Is there a way to modify that or the tsconfig
in that directory to verify this fixes the problem?
We could probably exclude the DOM library in |
My pleasure. Thank you for creating and maintaining one of the most helpful tools in the ecosystem.
Absolutely; there's a simple way to update the project's TypeScript configuration to verify that this pull request resolves the issue. Generally, it's best to expose as few global types as possible. As @fasttime said, updating the Since the project uses a composite TypeScript configuration (multiple configurations extending a shared base configuration), and none of them currently override |
- 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.
- The `CssNodePlain` type is a union that includes `Comment` as a member, making it redundant in the `CSSSyntaxElement` union.
Now that I’m not rushing around at 6pm on a Friday evening, I’ve had another look and realised that |
Comment
type importComment
member from CSSSyntaxElement
union
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Leaving open for @nzakas to verify before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work catching that! LGTM. Thanks.
Prerequisites checklist
What is the purpose of this pull request?
To resolve #118.
What changes did you make? (Give an overview)
Comment
from theCSSSyntaxElement
union.CssNodePlain
type is a union that includesComment
as a member, making it redundant in theCSSSyntaxElement
union. See: https://github.com/eslint/csstree/blob/main/lib/index.d.ts#L971.lib
TypeScript compiler option.lib
withtarget
, 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.Related Issues
Fixes #118.
Is there anything you'd like reviewers to focus on?
N/A.