Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ci: run against upcoming next major ESLint version #1534
ci: run against upcoming next major ESLint version #1534
Changes from 13 commits
09bae21
03462b0
eedf2b8
b3873a4
2b172ff
f910018
9a39b1e
6a66327
0d83cd1
d36a284
5929331
e42791c
4906b85
a1bf925
c641ecd
12d2769
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
why
satisfies
instead of assigning?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.
because assigning means it is
Config
- so all properties marked as required are such, and optional ones are that outside of the assignment; so TypeScript won't let us do things on those properties later down without existence checks - sadly it's not perfect: we've got to define properties we want to use since the type information is not retained after the assignment, which is why we've gotcoveragePathIgnorePatterns
explicitly defined with its default values.Having said that, I've not checked out
Config.InitialOptions
so that might change thingsThere 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.
Ok so
jest.Config
is just a re-export ofConfig.InitialOptions
- so yeah, we could do either or; I think usingsatisfies
is slightly nicer though.To make it a bit clearer:
that's what happens if you use assignment, and it's because to TypeScript
config
is typeConfig
rather than the actual object we created.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.
why is this needed?
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.
Because we're effectively running ESLint here per usual - so when using ESLint v9 we have to use flatconfig and when using pre-v9 we have to use legacy config.
While
linter.verify
supports being passed both types of configs, since we have calldefineRule
in pre-v9 (which errors in v9) this felt the cleanest way to address it (though either way we'll always needusingFlatConfig
.