-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Configuration Migration of ESLint configuration file from the eslintrc format to the new flat config format #1091
Conversation
Something went wrong in e2ff10e , I suspect some manual modification that ended up breaking the lockfile with this error message: "SyntaxError: Invalid value type 1540:0 in yarn.lock"
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 for starting this update!
Something was wrong with the yarn lockfile, I think maybe it got corrupted somehow, or you tried to manually correct something in there?
In any case I regenerated it so at least the tests can run.
This suggests to me that you did not try to run the linting locally, or at least not after the last commit. It is essential that you try running the linting command to make sure everythinng works as you expect it to.
That shows that at least the eslint.config.js file has a lot of linting issues, ironically :)
You can fix a lot of the issues automatically by running yarn lint eslint.config.js --fix
.
More problematically, the previous configuration file eslintrc.js still exists in the repo, and I can't tell you which config is used...
I suppose it should probably be deleted in favor of the new file.
Also do a global search in the repo for the file name, to replace it with the new one where appropriate.
I also think this PR would be the perfect occasion to update ESLint to v9 and allow us to test the changes with the target version; without that, i'm not sure the PR actually tests that the config changes will work for v9.
Thank you very much @MonkeyDo for again helping while solving the issue :) |
but at the same time eslint.config.js doesnt work with versions prior to v9, hence it doesnt make sense to leave it this way. One work-around I could find is import-js/eslint-plugin-import#2948 (comment) |
I read up ont he whole discussion, and it looks like v9 support in the plugin is going to take some time. |
Bump @insane-22, do you have the time to look into the alternate plugin, or would you prefer I do? |
Hello @MonkeyDo, sorry for this delay, was caught up in a few things and thanks a lot for this reminder. |
Hello hello, I'm back with new sets of errors :] "@eslint/[email protected]: The engine "node" is incompatible with this module. Expected version "^18.18.0 || ^20.9.0 || >=21.1.0". Got "20.6.1" " |
new versions supports ESLint 9
Sorry for another long delay 😶🌫️ I've updated the docker image for the base node image, and updated eslint-plugin-import which now supports ESLint v9 (I was keeping an eye on the PR/issue). |
Update import and export style, format the file according to its rules, and chasnge a couple of rules from errors into warnings (comma-dangle, quotes)
Thanks a lot for working on this, and for coming back to it multiple times :) |
Problem
According to ESLint's official docs- "The flat config file format has been the default configuration file format since ESLint v9.0.0". Codebase isn't updated with this new config
Solution
Added new eslint.config.js file and migrated code from .eslintrc.js and .eslintignore to this new config file