Skip to content

Commit

Permalink
add eslint compat layer
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoyu committed Jun 18, 2024
1 parent c1bffda commit 297690f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion packages/create-vite/template-react-ts/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fixupPluginRules } from "@eslint/compat";
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
Expand All @@ -15,7 +16,7 @@ export default [
parser: tsParser,
},
plugins: {
'react-hooks': reactHooks,
'react-hooks': fixupPluginRules(reactHooks),
'react-refresh': reactRefresh,
'@typescript-eslint': tsPlugin,
},
Expand Down
7 changes: 4 additions & 3 deletions packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@eslint/compat": "^1.1.0",
"@eslint/js": "^9.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^9.0.0",
"eslint": "^9.5.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"globals": "^15.6.0",
"typescript": "^5.2.2",
"typescript": "^5.4.5",
"vite": "^5.3.1"
}
}
5 changes: 3 additions & 2 deletions packages/create-vite/template-react/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fixupPluginRules } from "@eslint/compat";
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
Expand All @@ -20,8 +21,8 @@ export default [
},
},
plugins: {
react,
'react-hooks': reactHooks,
react: fixupPluginRules(react),
'react-hooks': fixupPluginRules(reactHooks),
'react-refresh': reactRefresh,
},
rules: {
Expand Down
13 changes: 7 additions & 6 deletions packages/create-vite/template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@eslint/compat": "^1.1.0",
"@eslint/js": "^9.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^9.0.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"globals": "^15.0.0",
"eslint": "^9.5.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"globals": "^15.6.0",
"vite": "^5.3.1"
}
}

0 comments on commit 297690f

Please sign in to comment.