forked from traccar/traccar-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
55 lines (54 loc) · 1.44 KB
/
Copy patheslint.config.js
File metadata and controls
55 lines (54 loc) · 1.44 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
import js from '@eslint/js';
import eslintReact from '@eslint-react/eslint-plugin';
import { configs as importConfigs } from 'eslint-plugin-import-x';
import reactHooks from 'eslint-plugin-react-hooks';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
export default [
{
ignores: ['build/**', 'switcher.js', 'theme.js', 'vite.config.js'],
},
js.configs.recommended,
eslintReact.configs.recommended,
importConfigs['flat/recommended'],
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: { ecmaFeatures: { jsx: true } },
globals: {
...globals.browser,
...globals.es2021,
},
},
plugins: {
'react-hooks': reactHooks,
},
settings: {
'import-x/resolver': {
node: {
extensions: ['.js', '.jsx', '.json'],
},
},
},
rules: {
'no-prototype-builtins': 'off',
'import-x/no-unresolved': [
'warn',
{
ignore: ['\\.svg', 'virtual:'],
},
],
'@eslint-react/set-state-in-effect': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'@eslint-react/no-array-index-key': 'off',
'@eslint-react/exhaustive-deps': [
'warn',
{ additionalHooks: '(useCatchCallback|useAsyncTask)$' },
],
},
},
prettierRecommended,
];