-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add basic Flat Config setup to README #96
Add basic Flat Config setup to README #96
Conversation
Thank you for suggesting this! Just curious, do you happen to have or know of a repository where the flat configuration is working as described here? It would help me with testing this out, though if not I'm happy to test it myself. |
I'll set up a quick vite project to clone for testing and post here. Edit: Here's the repo: https://github.com/Mitsunee/eslint-solid-flatconfig-test Unrelated: I was also going to ask if the setup I currently just have in the readme could be offered as a separate import (i.e. src/flat.ts assuming the types exist already) once it's tested properly. That would make setup for users a lot simpler. |
Not sure if you've gotten around to testing my initial proposal yet, but I've been tinkering and researching things a bit more and stumbled upon a promising approach by eslint-plugin-react which seems to allow using the same configs with both the legacy and the newer flat config systems. I can try apply this same method in this PR (or a new one) if you want, or go with my original idea of adding a separate export such as |
Thanks for looking into this more, and I appreciate your patience as I haven't had much time to work on this. I like the idea of using the same config for both config systems as much as possible—I get the feeling that "legacy" config is still going to be around for years. To make sure I'm understanding right, to do this we would
I'd love to see this happen—it feels like a better approach to focus on creating good, shareable flat configs, and then porting the legacy configs to use it under the hood. I can take this if you want, but I'd appreciate your help in making that happen in this PR. Thanks so much! |
I agree that it's vital to keep supporting both types of configs for now, especially as ESLint are still at least one major version away from removing support for it and it does take some migration to switch systems. I'll give this a shot later, just got one question: Setting global variables (previously the |
This comment was marked as outdated.
This comment was marked as outdated.
I should actually read errors my IDE shows, the error I did get was not from ESLint but from TypeScript which also complains about duplicate properties. Turns out the This behaviour is the same with the current production version of the legacy configs (in fact I was using the one from npm in the screenshot above) so fixing that is not within the scope of this PR (could be done with overrides using the same Questions before merging:
|
I'm happy to defer to precedent for all these if there is one, but I understand it's early days.
|
I also noticed that the typescript config of the current release does not actually include the parserOptions, which I accidentally fixed in this PR. |
This should make it easier to maintain the configs as changes to the recommended config won't need to be copypasted over to the TS config and it's more immediatly clear where the configs differ.
…JS/ESM for configs.
Thank you very much for your patience—ended up matching the flat configs up with the legacy configs for easier migration to flat ESLint. Just wanted to make sure what we recommend is tested and this is what made the testing work. TS users will need to configure the parser for themselves (since there are multiple options out there) so I left Thanks again! |
Adds some basic Flat Config setup instructions.
I tried to keep it as similar as possible to the current configs (with browser+es6 env and using "eslint:recommended" as a base config). I am unsure if
impliedStrict
is supported in Flat Configs right now, so I omitted that one.