refactor: update ESLint configuration to include prettier and adjust rules
This commit is contained in:
parent
6829bc86fc
commit
bf831b9c46
@ -9,6 +9,7 @@ import eslintPluginUnicorn from 'eslint-plugin-unicorn'
|
|||||||
import reactPlugin from 'eslint-plugin-react'
|
import reactPlugin from 'eslint-plugin-react'
|
||||||
import pluginQuery from '@tanstack/eslint-plugin-query'
|
import pluginQuery from '@tanstack/eslint-plugin-query'
|
||||||
import unusedImports from 'eslint-plugin-unused-imports'
|
import unusedImports from 'eslint-plugin-unused-imports'
|
||||||
|
import eslintConfigPrettier from 'eslint-config-prettier'
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
{ ignores: ['dist', 'node_modules', '.react-router'] },
|
{ ignores: ['dist', 'node_modules', '.react-router'] },
|
||||||
@ -19,6 +20,7 @@ export default tseslint.config(
|
|||||||
jsxA11y.flatConfigs.recommended,
|
jsxA11y.flatConfigs.recommended,
|
||||||
importPlugin.flatConfigs.recommended,
|
importPlugin.flatConfigs.recommended,
|
||||||
eslintPluginUnicorn.configs['flat/recommended'],
|
eslintPluginUnicorn.configs['flat/recommended'],
|
||||||
|
eslintConfigPrettier,
|
||||||
],
|
],
|
||||||
files: ['**/*.{ts,tsx}'],
|
files: ['**/*.{ts,tsx}'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
@ -44,6 +46,9 @@ export default tseslint.config(
|
|||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
react: {
|
||||||
|
version: 'detect',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...reactHooks.configs.recommended.rules,
|
...reactHooks.configs.recommended.rules,
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
"ignoreDependencies": [
|
"ignoreDependencies": [
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"@tailwindcss/typography",
|
"@tailwindcss/typography",
|
||||||
"react-router-devtools",
|
"react-router-devtools"
|
||||||
"eslint-import-resolver-typescript"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
"@types/react-dom": "^19.0.1",
|
"@types/react-dom": "^19.0.1",
|
||||||
"@typescript-eslint/parser": "^8.22.0",
|
"@typescript-eslint/parser": "^8.22.0",
|
||||||
"eslint": "^8.0.1",
|
"eslint": "^8.0.1",
|
||||||
"eslint-import-resolver-typescript": "^3.7.0",
|
"eslint-config-prettier": "^10.0.1",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||||
"eslint-plugin-react": "^7.37.4",
|
"eslint-plugin-react": "^7.37.4",
|
||||||
|
|||||||
13
pnpm-lock.yaml
generated
13
pnpm-lock.yaml
generated
@ -114,6 +114,9 @@ importers:
|
|||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.0.1
|
specifier: ^8.0.1
|
||||||
version: 8.57.1
|
version: 8.57.1
|
||||||
|
eslint-config-prettier:
|
||||||
|
specifier: ^10.0.1
|
||||||
|
version: 10.0.1(eslint@8.57.1)
|
||||||
eslint-import-resolver-typescript:
|
eslint-import-resolver-typescript:
|
||||||
specifier: ^3.7.0
|
specifier: ^3.7.0
|
||||||
version: 3.7.0(eslint-plugin-import@2.31.0)(eslint@8.57.1)
|
version: 3.7.0(eslint-plugin-import@2.31.0)(eslint@8.57.1)
|
||||||
@ -2164,6 +2167,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
eslint-config-prettier@10.0.1:
|
||||||
|
resolution: {integrity: sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==}
|
||||||
|
hasBin: true
|
||||||
|
peerDependencies:
|
||||||
|
eslint: '>=7.0.0'
|
||||||
|
|
||||||
eslint-import-resolver-node@0.3.9:
|
eslint-import-resolver-node@0.3.9:
|
||||||
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
|
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
|
||||||
|
|
||||||
@ -6411,6 +6420,10 @@ snapshots:
|
|||||||
|
|
||||||
escape-string-regexp@4.0.0: {}
|
escape-string-regexp@4.0.0: {}
|
||||||
|
|
||||||
|
eslint-config-prettier@10.0.1(eslint@8.57.1):
|
||||||
|
dependencies:
|
||||||
|
eslint: 8.57.1
|
||||||
|
|
||||||
eslint-import-resolver-node@0.3.9:
|
eslint-import-resolver-node@0.3.9:
|
||||||
dependencies:
|
dependencies:
|
||||||
debug: 3.2.7
|
debug: 3.2.7
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user