-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
89 lines (85 loc) · 2.27 KB
/
eslint.config.js
File metadata and controls
89 lines (85 loc) · 2.27 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
const js = require('@eslint/js');
const tseslint = require('typescript-eslint');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
module.exports = tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
'react': reactPlugin,
'react-hooks': reactHooksPlugin,
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
window: 'readonly',
document: 'readonly',
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
exports: 'writable',
module: 'writable',
require: 'readonly',
global: 'readonly',
anime: 'readonly',
gsap: 'readonly',
ScrollMagic: 'readonly',
AOS: 'readonly',
},
},
rules: {
// TypeScript rules
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// React rules
'react/prop-types': 'off', // We use TypeScript for prop validation
'react/react-in-jsx-scope': 'off', // Not needed in React 18+
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// General rules
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'warn',
'no-alert': 'warn',
'prefer-const': 'error',
'no-var': 'error',
'eqeqeq': ['error', 'always', { null: 'ignore' }],
// Allow some patterns common in the codebase
'no-undef': 'off', // TypeScript handles this
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
ignores: [
'dist/**',
'build/**',
'node_modules/**',
'*.min.js',
'coverage/**',
'.vscode/**',
'.idea/**',
'**/*.config.js',
'vite.config.ts',
],
}
);