-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
38 lines (38 loc) · 1.01 KB
/
eslint.config.js
File metadata and controls
38 lines (38 loc) · 1.01 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
export default [
{ ignores: ['dist', 'dist-electron', 'node_modules'] },
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: { BrowserWindow: 'readonly', ipcRenderer: 'readonly', process: 'readonly' },
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.2' } },
plugins: {
react: {},
'react-hooks': {},
'@typescript-eslint': {},
},
rules: {
...ReactHooksRules,
...ReactRules,
...TypeScriptRules,
},
},
]
const ReactRules = {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
}
const ReactHooksRules = {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
}
const TypeScriptRules = {
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
}