Skip to content

Commit

Permalink
fix(react-vite): Update eslint and use new config file (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Feb 26, 2025
1 parent cfaa933 commit 341ded1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
17 changes: 0 additions & 17 deletions react-vite/base/.eslintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions react-vite/base/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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', 'cypress.config.ts'] },
{
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 },
],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
},
)
6 changes: 5 additions & 1 deletion react-vite/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@
"@vitejs/plugin-legacy": "^5.0.0",
"@vitejs/plugin-react": "^4.0.1",
"cypress": "^13.5.0",
"eslint": "^8.35.0",
"eslint": "^9.20.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"jsdom": "^22.1.0",
"terser": "^5.4.0",
"typescript": "^5.1.6",
"typescript-eslint": "^8.24.0",
"vite": "~5.2.0",
"vitest": "^0.34.6"
}
Expand Down

0 comments on commit 341ded1

Please sign in to comment.