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
Support eslint's new flat config #176
Conversation
This seems worth splitting into two PRs - one changing the way the tests work, and another after that lands that adds support for eslint's flat config? |
I could @ljharb but it seems like unnecessary churn, especially if the two PRs will land one after another and if the only motivation to do the one is in order to introduce the other. |
The point would be to a) reduce the git diff size, and b) prove that the test refactors pass without changing the production code, both of which reduce the risk of any change. |
Fair enough, I'll split it up tomorrow and will investigate the failing tests tomorrow. New PRs inbound soon. |
Let's try to send just one new PR, and update this one to be one of the two parts :-) Thanks! |
@ljharb I'm going to put this on hold for a bit for two reasons:
If both of those last 2 work out, and once #177 gets merged, this PR will turn into effectively just a one-line change of an import path I'll keep the PR open until I wrap those other changes up and then will rebase accordingly and ping you when I think it's ready to merge. |
a2bfdc4
to
83c2079
Compare
@ljharb I think this PR is good to merge now if you'd like. I'm guessing it will take the eslint folks some time to get back to me on eslint/eslint#17129 and then I'll need to implement and PR and merge whenever they suggest. I'm happy to wait on that and then update this PR once something lands, or also happy to get this merged in and then go back and put in a follow-up PR whenever the eslint side moves forward. |
@ljharb OK I think that should do it, I added an integration test to be sure we don't try to load the config using the flat format on eslint versions that don't support it. Let me know if there's anything else you'd suggest. Thanks for the reviews & help getting these merged! |
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.
this should be rebased, but otherwise lgtm. not going to merge without other reviews tho
rebased, thanks @ljharb |
addressed your comments, thanks @SimenB |
FYI that I just added a change to cache the ESLintConstructor value as I noticed the performance with this PR was quite poor due to traversing the filesystem to find the |
@ljharb @SimenB any other changes ya'll would like to see here? did you want to ice this pending any outcome of eslint/eslint#17129 or were you guys cool with merging and I can do a follow up if/when that ticket moves along? |
b3ab755
to
d31ac24
Compare
@ljharb @SimenB eslint v8.41.0 has been released, including my change to expose I think the only deficiency in this PR at this point is that I didn't add any CI to test with eslint versions between v8.0.0 - v8.40.0. I don't think that's necessary and it felt like overkill to me, but I'd be happy to go back and add it if ya'll feel it's important. Other than that, I think it's good to ship. Thanks again for the patience and help folks. |
A test run for 8.40 could be nice, but if it proves hard I don't think it's a blocker 🙂 At least as long as we still test v7 I think it's highly unlikely we'll break anything |
No problem, added 8.40 to the test matrix. It might prove to be overkill and wasted github action time but it's easy to strip out from the matrix config down the line. |
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, and sorry for the delay!
Currently afk, but I can release this tonight or tomorrow morning (CEST), unless @ljharb gets to it 🙂
No worries at all, thanks for all the help getting this over the finish line! |
Fixes #166 .
Note I also had to change the strategy for running integration tests is this PR. Prior to this PR, integration tests ran in a child process where the cwd was the root of the integration tests, and jest projects were used to select individual integration test directories. However, eslint will look for the flat config starting in the process cwd, so with that strategy the flat config would have to be placed in a common path to all integration tests, and thus the integration test runs would always detect that they're running in flat config mode.
As of this PR, the integration tests run with a child process where the cwd is the individual integration test fixture path as well. Practically, this required updating some snapshots and moving some
.eslintignore
entries into the test fixture folders.