-
Notifications
You must be signed in to change notification settings - Fork 55
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
upgrade the eslint lib to v9 #570
base: main
Are you sure you want to change the base?
Conversation
I want to preface this by saying I'm still new eslint plugin development (and eslint in general), so there are still some things I'm not 100% sure of. I've come to conclusion that there's 2 separate things here (definitely intertwined with each other still).:
This PR upgrades us to eslint v9; however, I think more than upgrading to eslint v9, we want to support flat config. Flat config I believe is available from 8.57.0 and on. So, we don't necessarily need to upgrade to v9 to support flat config. But if we do, even better. At the very least, we want to be backwards compatible, so we don't break things for folks who haven't updated to flat config (regardless of version). If we're fine with breaking changes for folks not on flat config, this is a different story, but even so I think we'd still have work to do since our exported configs are not flat config. I think in order for us to be backwards compatible, we'll need to export both legacy and flat configs as mentioned here. In addition, I think we should update our plugin structure. I found some examples of other plugins that have both configs:
I think that may be the reason for some of the issues I ran into. Bc I took clipboard-copy-element which is on v8.42.0 (no flat config). I
And, when I ran it with the current This is the section that I think affects us: https://eslint.org/docs/latest/extend/plugin-migration-flat-config#migrating-configs-for-flat-config since we do export configs, and those are not flat configs. We'll want both legacy and flat configs. Let me know if I'm misunderstanding something here. |
I’m using ref: https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config |
ref #539
upgrade the eslint lib to v9 by following this doc https://eslint.org/docs/latest/use/migrate-to-9.0.0
also updated
context.getScope()
by this https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getscope() to resolve errorwe have both
.eslintrc.js
to support eslint v8 andeslint.config.mjs
to support eslint v9