-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
105 lines (100 loc) · 2.74 KB
/
eslint.config.js
File metadata and controls
105 lines (100 loc) · 2.74 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
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
export default [
// Ignore patterns (replaces .eslintignore)
{
ignores: [
'generated-servers/**',
'dist/**',
'build/**',
'node_modules/**',
'_test/**',
'*.config.js',
'*.config.ts',
],
},
// Base ESLint recommended rules
js.configs.recommended,
// TypeScript files configuration
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
Blob: 'readonly',
FileReader: 'readonly',
HTMLInputElement: 'readonly',
HTMLElement: 'readonly',
Element: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearTimeout: 'readonly',
clearInterval: 'readonly',
fetch: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
FormData: 'readonly',
// Node.js globals
process: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
require: 'readonly',
module: 'readonly',
exports: 'readonly',
global: 'readonly',
Buffer: 'readonly',
crypto: 'readonly',
// ES2022 globals
Promise: 'readonly',
Symbol: 'readonly',
Map: 'readonly',
Set: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Array: 'readonly',
Object: 'readonly',
String: 'readonly',
Number: 'readonly',
Boolean: 'readonly',
Date: 'readonly',
RegExp: 'readonly',
Error: 'readonly',
JSON: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
// TypeScript ESLint recommended rules
...tseslint.configs.recommended.rules,
// React Hooks rules
...reactHooks.configs.recommended.rules,
// Custom rules from .eslintrc.json
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
// Allow 'any' for dynamic API parsing, error handling, and template helpers
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
},
},
];