fix(create-vite): remove eslint-plugin-react#19514
Merged
Conversation
ArnaudBarre
reviewed
Feb 25, 2025
Co-authored-by: Arnaud Barré <arnaud.barre@carbometrix.com>
ArnaudBarre
approved these changes
Feb 26, 2025
| }, | ||
| } | ||
| ``` | ||
| If you are developing a production application, we recommend using TypeScript and enable type-aware lint rules. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. |
| - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` | ||
| - Optionally add `...tseslint.configs.stylisticTypeChecked` | ||
| - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: | ||
| You can also install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) for React-specific lint rules: |
Member
There was a problem hiding this comment.
Maybe we can already mention it? Even if the code example is still for eslint-plugin-react
Suggested change
| You can also install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) for React-specific lint rules: | |
| You can also install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) or [[eslint-plugin-react-x](eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react) for React-specific lint rules: |
Member
Author
There was a problem hiding this comment.
Yeah maybe it's not a lot of work left than I expected. I wanted to rewrite this part to eslint-plugin-react-x only though and suggest a code example for it.
I'll try to get to that later, but if not I think this PR is ok to be merged and I can create another PR later.
Member
There was a problem hiding this comment.
As you prefer, thanks for doing this!
moonlitusun
pushed a commit
to moonlitusun/vite
that referenced
this pull request
May 25, 2025
Co-authored-by: Arnaud Barré <arnaud.barre@carbometrix.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
eslint-plugin-reactis setup in the react js template only as it requires thereact/jsx-use-varsrule to properly check if a React component is used by eslint. It's not needed in the TS template astypescript-eslintuses typescript itself to check for unused vars instead, which is more accurate.It feels a bit overkill to add a large dependency to handle this case, or introducing a single package with a single rule dealing with this. So I think it's easiest to ignore the var checks for variables that starts with an uppercase for now.
Alternatively we could keep things as is, so I wonder what others think about this. But I think it's useful to keep the dependency size down so it's easier for users to try out the template.