-
-
Notifications
You must be signed in to change notification settings - Fork 35
Update ESLint config in README for React plugin #1379
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: mrsmiitth <[email protected]>
|
@mrsmiitth is attempting to deploy a commit to the Rel1cx's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull request overview
This PR attempts to update the ESLint configuration example in the README for the eslint-plugin-react-x package to use a newer flat config format with array syntax. However, the update introduces several critical issues that prevent the example from being valid or functional.
Key issues:
- The example mixes old and new code, leaving obsolete imports and duplicating comments
- The configuration uses an invalid "extends" field for the flat config format
- Missing imports for functions like globalIgnores
- Missing closing code fence for the code block
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| react.configs.recommended, | ||
| // Other configs... | ||
| // Enable lint rules for React | ||
| reactX.configs['recommended-typescript'], | ||
| // Enable lint rules for React DOM | ||
| reactDom.configs.recommended, | ||
| ], |
Copilot
AI
Jan 8, 2026
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.
The "extends" field should be removed from the configuration object. In the flat config format used here (with array syntax), configuration sharing is done by spreading objects in the array, not using an "extends" field. The correct approach is to spread the config objects directly in the array at the top level.
| react.configs.recommended, | ||
| // Other configs... | ||
| // Enable lint rules for React | ||
| reactX.configs['recommended-typescript'], |
Copilot
AI
Jan 8, 2026
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.
The quote style is inconsistent. This should use double quotes to match the established pattern in other plugin READMEs in this repository.
| parser: tseslint.parser, | ||
| parserOptions: { | ||
| projectService: true, | ||
| project: ['./tsconfig.node.json', './tsconfig.app.json'], |
Copilot
AI
Jan 8, 2026
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.
The quote style is inconsistent. These strings should use double quotes to match the established pattern in other plugin READMEs in this repository.
| import tseslint from "typescript-eslint"; | ||
|
|
||
| export default defineConfig( | ||
| // eslint.config.js |
Copilot
AI
Jan 8, 2026
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.
The comment "// eslint.config.js" is duplicated. It already appears on line 15 at the beginning of this code block and should not be repeated here.
| // eslint.config.js |
| import reactX from 'eslint-plugin-react-x' | ||
| import reactDom from 'eslint-plugin-react-dom' |
Copilot
AI
Jan 8, 2026
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.
The quote style is inconsistent with the rest of the codebase. All other plugin READMEs in this repository use double quotes for strings. These imports should use double quotes instead of single quotes to maintain consistency.
| import reactX from 'eslint-plugin-react-x' | |
| import reactDom from 'eslint-plugin-react-dom' | |
| import reactX from "eslint-plugin-react-x" | |
| import reactDom from "eslint-plugin-react-dom" |
| import reactDom from 'eslint-plugin-react-dom' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), |
Copilot
AI
Jan 8, 2026
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.
The globalIgnores function is called without being imported. The example code needs to either import this function or show where it comes from for the documentation to be accurate.
| globalIgnores(['dist']), | ||
| { | ||
| files: ["**/*.ts", "**/*.tsx"], | ||
| files: ['**/*.{ts,tsx}'], |
Copilot
AI
Jan 8, 2026
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.
The quote style is inconsistent. This should use double quotes to match the established pattern in other plugin READMEs in this repository.
| }, | ||
| ); | ||
| ``` | ||
| ]) |
Copilot
AI
Jan 8, 2026
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.
The code block is missing a closing code fence. A line with ``` should be added after this line to properly close the JavaScript code block that starts on line 14.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___)Other information