-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy patheslint.config.js
More file actions
109 lines (108 loc) · 2.8 KB
/
eslint.config.js
File metadata and controls
109 lines (108 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactPlugin from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactCompiler from 'eslint-plugin-react-compiler'
import reactRefresh from 'eslint-plugin-react-refresh'
import prettierConfig from 'eslint-config-prettier'
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2022,
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooks,
'react-compiler': reactCompiler,
'react-refresh': reactRefresh,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react-compiler/react-compiler': 'error',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/no-import-type-side-effects': 'error',
},
settings: {
react: {
version: 'detect',
},
},
},
prettierConfig,
{
files: ['src/components/ui/**/*.{ts,tsx}', 'src/test/**/*.{ts,tsx}'],
rules: {
'react-refresh/only-export-components': 'off',
// Disable compiler rule for UI components (from shadcn) and test files
'react-compiler/react-compiler': 'off',
},
},
{
files: ['scripts/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
},
},
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
ignores: [
'dist/**',
'node_modules/**',
'src-tauri/target/**',
'src-tauri/gen/**',
'*.config.js',
'*.config.ts',
'vite.config.ts',
'src/lib/bindings.ts', // Auto-generated by tauri-specta
],
}
)