forked from wger-project/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
54 lines (51 loc) · 1.62 KB
/
eslint.config.js
File metadata and controls
54 lines (51 loc) · 1.62 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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
// import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
'react': reactPlugin,
'react-hooks': reactHooksPlugin,
'import': importPlugin,
//'jsx-a11y': jsxA11yPlugin
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
react: {
version: 'detect'
}
}
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'semi': ['error', 'always'],
'camelcase': ['warn'],
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/no-explicit-any": ["error"],
"@typescript-eslint/no-non-null-asserted-optional-chain": ["warn"],
"@typescript-eslint/no-unsafe-function-type": ["warn"],
"@typescript-eslint/ban-ts-comment": [
"warn", // changed to warning
{
"ts-ignore": "allow-with-description",
"ts-expect-error": "allow-with-description",
"minimumDescriptionLength": 10
}
],
}
},
{
ignores: ['build/**/*']
}
);