Skip to content

Commit 2e73b8e

Browse files
CopilotStan2032
andcommitted
Fix ESLint TypeScript parsing: add @typescript-eslint/parser, resolve all lint errors
Co-authored-by: Stan2032 <68326386+Stan2032@users.noreply.github.com>
1 parent e73fa66 commit 2e73b8e

9 files changed

Lines changed: 352 additions & 11 deletions

eslint.config.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import js from '@eslint/js'
22
import globals from 'globals'
33
import reactHooks from 'eslint-plugin-react-hooks'
44
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tsParser from '@typescript-eslint/parser'
6+
import tsPlugin from '@typescript-eslint/eslint-plugin'
57
import { defineConfig, globalIgnores } from 'eslint/config'
68

79
export default defineConfig([
810
globalIgnores(['dist']),
911
{
10-
files: ['**/*.{js,jsx,ts,tsx}'],
12+
files: ['**/*.{js,jsx}'],
1113
ignores: ['backend/**', 'src/test/**'],
1214
extends: [
1315
js.configs.recommended,
@@ -28,6 +30,34 @@ export default defineConfig([
2830
'react-refresh/only-export-components': 'warn',
2931
},
3032
},
33+
{
34+
files: ['**/*.{ts,tsx}'],
35+
ignores: ['backend/**', 'src/test/**'],
36+
extends: [
37+
js.configs.recommended,
38+
reactHooks.configs.flat.recommended,
39+
reactRefresh.configs.vite,
40+
],
41+
languageOptions: {
42+
ecmaVersion: 2020,
43+
globals: globals.browser,
44+
parser: tsParser,
45+
parserOptions: {
46+
ecmaVersion: 'latest',
47+
ecmaFeatures: { jsx: true },
48+
sourceType: 'module',
49+
},
50+
},
51+
plugins: {
52+
'@typescript-eslint': tsPlugin,
53+
},
54+
rules: {
55+
'no-unused-vars': 'off',
56+
'no-undef': 'off',
57+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^([A-Z_]|motion$)', argsIgnorePattern: '^(_|[A-Z])', destructuredArrayIgnorePattern: '^_' }],
58+
'react-refresh/only-export-components': 'warn',
59+
},
60+
},
3161
{
3262
files: ['public/sw.js'],
3363
languageOptions: {

package-lock.json

Lines changed: 313 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)