-
Notifications
You must be signed in to change notification settings - Fork 342
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
Enable Flat Config by default #1644
Comments
This might not be easy to enable by default since the ESLint server doesn't start on the workspace folder root. |
Flat config is enabled by default from ESLint v9.0.0 and the ".eslintrc.*" format seems to be removed in v10.0.0 |
Any ETA on that? It's pretty weird that it's considered as experimental feature. It should be default for sure since flat config is becoming standard. Extension should keep up with library :) |
const {shouldUseFlatConfig} = require("eslint/use-at-your-own-risk");
shouldUseFlatConfig(); |
@dbaeumer I think |
@nzakas the reason why I haven't switch yet is that I am under the impression that to get to the new Has this changed? What I would like to do is to import |
@dbaeumer the For the latest v8 and all of v9, Full details here: |
Reading the link from above brought me to the following conclusion:
From my experiences designing API, it would have been easier for API users, if the API would have added new names and removed old names instead if reusing names and changing the meaning. The first would have avoided checking the version since the pure existence of a name would introduce a behavior. In VS Code we usually use a function to load the API to which you can pass a parameter to determine if you want proposed API. If you opt into this they are put into the same namespace. @nzakas any change to revisit the rollout plan especially around the meaning change of ESLint -> FlatESLint. |
I appreciate the feedback, but at this point we are weeks away from a beta (three alpha releases have already been published), so revisiting the rollout plan really isn't in the cards. To clarify: the change to the behavior of
Can you give an example of this? I'm not opposed to adding something along these lines, but need to see it in action in order to evaluate. |
Actually I don't want to change the timing. I understand that this is not possible. I was more hoping for some sort of additional API to make this easier for API users that need to support 8.x, 9.x and 10.x Let me first explain what we do in VS Code and LSP to mitigate those changes. In general we do two things:
VS Code
ESLintFor ESLint it would be cool to have the following:
If proposed is false then the Something like this would allow to use the API without checking version to interpret names differently. Let me know if something like this would be possible? |
Because we are getting into API design, let's continue this conversation in the ESLint repo here: |
No need to load the
I'm afraid it won't be easy to add an additional API to already published versions of ESLint 8.x. But it could be added in v9 if it simplifies the upgrade to v10. |
The new API has been released in both the v8.x and v9.x branches: |
@dbaeumer with the new API provided by ESLint does that mean that a single VSCode workspace will be able to use both flat and eslintrc configs depending on what ESLint files exist in the current working directory when using ESLint 8? It appears that the current
|
@lubaker I haven't tried the new API so I can't tell yet :-) |
Based on the new API from @nzakas I created a new alpha version of the extension. It can be found here: https://github.com/microsoft/vscode-eslint/releases/tag/3.0.1-alpha.1 If you use 8.57.0 or above it should auto detect flat config. I also has a big change to move to pull diagnostics which gives us better validation scheduling and validating on focus change. To install it download the VSIX and execute the command Would be great to get some early feedback since most of my repositories are still using the old config style :-) |
This appears to work for me. I'm using ESLint 8.57.0 with your alpha and the "Use Flat Config" setting unchecked. In a directory with a flat config, it is linting using the flat configuration and in directories with the old config style, it lints using that config. 💯 |
eslint v9 has been released: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/ |
@dbaeumer is there a timeline for a beta or final release? |
I want to release a new version (not pre-release) beginning of next week. However there will still be a loose end with yarn pnp and mjs files. The details are here: yarnpkg/berry#6219 To make that work we need a new yarn version and VS Code being move to Electron 29 which will be the case with the next stable release. |
Hello @dbaeumer , is there anything preventing releasing a new (not pre-release) version containing this change? And later another minor/patch version containing the yarn fix you mentioned? Thanks |
Shipped 3.0.10 today. |
… eslint.useFlatConfig * As eslint extension now supports eslint.useFlatConfig. See microsoft/vscode-eslint#1644 (comment)
… eslint.useFlatConfig * As eslint extension now supports eslint.useFlatConfig. See microsoft/vscode-eslint#1644 (comment)
@dbaeumer and others involved, thanks for the work getting this published! What is the upgrade path for users who want to use flat config (or who want to opt out of flat config) on ESLint version 8, 9, and 10? Eg:
It seems like from the flat config rollout plans like the I opened an issue over here about adding docs about |
Flat Config is now considered complete:
eslint/eslint@7162d34
Seems it should no longer be masked behind
eslint.experimental.useFlatConfig
.The text was updated successfully, but these errors were encountered: