Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

upgrade the eslint lib to v9#570

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ejahnGithub wants to merge5 commits intomainfromupdate/eslint-v9
Closed

Conversation

ejahnGithub
Copy link

@ejahnGithubejahnGithub commentedNov 6, 2024
edited
Loading

ref#539

upgrade the eslint lib to v9 by following this dochttps://eslint.org/docs/latest/use/migrate-to-9.0.0

also updatedcontext.getScope() by thishttps://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getscope() to resolve error

we have both.eslintrc.js to support eslint v8 andeslint.config.mjs to support eslint v9

Elyytscha reacted with thumbs up emoji
@ejahnGithubejahnGithub requested a review froma team as acode ownerNovember 6, 2024 00:02
@ejahnGithubejahnGithub changed the titleupdate the eslint lib to v9upgrade the eslint lib to v9Nov 6, 2024
@gracepark
Copy link
Contributor

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).:

  • Support flat config (eslint.config.js)
  • Upgrade to eslint v9

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 from8.57.0 and on. So, we don't necessarilyneed 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 notflat config.

I think in order for us to be backwards compatible, we'll need to exportboth legacy and flat configs as mentionedhere. In addition, I think we should update our plugin structure.

I found some examples of other plugins that have both configs:

Ithink that may be the reason for some of the issues I ran into. Bc I tookclipboard-copy-element which is on v8.42.0 (no flat config). Inpm link-ed with this PR and I ran into an error, and even if I do install the plugin as mentioned, I have to end up dl-ing every plugin that was referenced in the config file (which I think makes sense):

Oops! Something went wrong! :(ESLint: 8.42.0ESLint couldn't find the plugin "eslint-plugin-escompat".(The package "eslint-plugin-escompat" was not found when loaded as a Node module from the directory "/Users/gracepark/github/clipboard-copy-element".)It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:    npm install eslint-plugin-escompat@latest --save-devThe plugin "eslint-plugin-escompat" was referenced from the config file in ".eslintrc.json » plugin:github/browser".If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

And, when I ran it with the currenteslint-plugin-github package, I did not run into these errors.

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 doexport configs, and those are not flat configs. We'll want both legacy and flat configs.

Let me know if I'm misunderstanding something here.

ejahnGithub reacted with thumbs up emoji

@ejahnGithub
Copy link
Author

I’m usingFlatCompat to handle the transition toFlat Config. This allows to integrate legacy.eslintrc configurations and plugins without a complete refactor, maintaining compatibility while gradually updating to the Flat Config format.

ref:https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@manuelpuyolmanuelpuyolAwaiting requested review from manuelpuyolmanuelpuyol is a code owner automatically assigned from github/web-systems-reviewers

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ejahnGithub@gracepark

[8]ページ先頭

©2009-2025 Movatter.jp