-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: ESLint compat utilities post #564
Conversation
Hi @nzakas!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
✅ Deploy Preview for ja-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for new-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for zh-hans-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for es-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for pt-br-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for hi-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for fr-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for de-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
LGTM, I only left two suggestions/questions.
``` | ||
|
||
After that, the plugin should work as expected. | ||
|
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.
Would it make sense to also provide an example with a plugin that exports a flat config?
For example, eslint-plugin-react exports flat configs:
Rules aren't compatible with the new API yet, but the config can be used like this:
// eslint.config.js
import { fixupConfigRules } from "@eslint/compat";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
export default [
...fixupConfigRules(reactRecommended)
];
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.
Good idea.
export default [ | ||
{ | ||
plugins: { | ||
oldPlugin: fixupPluginRules(oldPlugin) |
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.
oldPlugin: fixupPluginRules(oldPlugin) | |
"old-plugin": fixupPluginRules(oldPlugin) |
Maybe like this to match the plugin name in eslintrc?
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.
This isn't an eslintrc example, so I think it's okay as-is.
Co-authored-by: Milos Djermanovic <[email protected]>
* post: ESLint compat utilities * Update src/content/blog/2024-05-09-eslint-compatibility-utilities.md Co-authored-by: Milos Djermanovic <[email protected]> * Apply feedback --------- Co-authored-by: Milos Djermanovic <[email protected]>
Prerequisites checklist
What is the purpose of this pull request?
What changes did you make? (Give an overview)
Added a blog post introducing the compatibility utilities.
Related Issues
eslint/rewrite#4
Is there anything you'd like reviewers to focus on?