-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
143 lines (136 loc) 路 3.52 KB
/
Copy patheslint.config.js
File metadata and controls
143 lines (136 loc) 路 3.52 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
export default [
// Base configuration for all files
{
ignores: [
'dist/**',
'node_modules/**',
'.tmp-tests/**',
'scripts/**',
'*.config.js',
'*.config.ts',
'vite.config.ts',
'postcss.config.js',
'tailwind.config.js',
'.vercel/**',
'build/**',
'out/**',
'coverage/**'
]
},
// JavaScript files
js.configs.recommended,
// TypeScript files
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
globals: {
console: 'readonly',
localStorage: 'readonly',
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
fetch: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
KeyboardEvent: 'readonly',
HTMLDivElement: 'readonly',
HTMLInputElement: 'readonly',
MouseEvent: 'readonly',
Element: 'readonly',
HTMLElement: 'readonly',
alert: 'readonly',
Response: 'readonly',
Request: 'readonly',
Headers: 'readonly',
Blob: 'readonly',
URL: 'readonly',
crypto: 'readonly',
document: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint
},
rules: {
'no-undef': 'off', // TypeScript handles this via compiler
// Basic TypeScript rules
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}],
'@typescript-eslint/no-explicit-any': 'off', // Too strict for development
'@typescript-eslint/no-var-requires': 'error'
}
},
// React files
{
files: ['**/*.tsx', '**/*.jsx'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
// React specific rules
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
'react/prop-types': 'off', // Using TypeScript for prop validation
'react/jsx-uses-react': 'off', // Not needed in React 17+
'react/jsx-uses-vars': 'error'
},
settings: {
react: {
version: 'detect'
}
}
},
// Test files
{
files: ['**/*.test.ts', '**/*.test.tsx', 'src/tests/**'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off'
}
},
// Source files with standard rules
{
files: ['src/**/*.{ts,tsx}'],
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'no-alert': 'warn',
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}],
'@typescript-eslint/no-explicit-any': 'off'
}
}
];