Description
When creating project from template React + TypeScript we got this ESLint config
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
I think we should simplify it to this version.
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['dist'],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
)
This updated version is also more compliant with docs for various packages, i.e.


https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
https://github.com/ArnaudBarre/eslint-plugin-react-refresh
Suggested solution
Simplify ESLint config in templates
Alternative
No response
Additional context
No response
Validations
Description
When creating project from template React + TypeScript we got this ESLint config
I think we should simplify it to this version.
This updated version is also more compliant with docs for various packages, i.e.
https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
https://github.com/ArnaudBarre/eslint-plugin-react-refresh
Suggested solution
Simplify ESLint config in templates
Alternative
No response
Additional context
No response
Validations