-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
83 lines (83 loc) · 2.37 KB
/
.eslintrc.cjs
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
// eslint-disable-next-line no-undef
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
'plugin:storybook/recommended'
],
plugins: ['@typescript-eslint', 'prettier', 'no-only-tests', 'react', 'react-hooks'],
rules: {
'no-restricted-globals': [
'error',
{
name: 'parent',
message: 'Do not use window parent'
},
{
name: 'name',
message: 'Use local parameter instead.'
},
{
name: 'event',
message: 'Use local parameter instead.'
},
{
name: 'fdescribe',
message: 'Do not commit fdescribe. Use describe instead.'
}
],
'no-async-promise-executor': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'no-console': ['warn'],
'prefer-const': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-only-tests/no-only-tests': 'error',
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'error',
'react/prop-types': 'off',
// '@typescript-eslint/no-unused-vars': ['error', {varsIgnorePattern: '^React$'}],
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn' // Checks effect dependencies
},
settings: {
react: {
version: 'detect'
}
},
ignorePatterns: ['*.js', '*.cjs'],
overrides: [
{
files: ['./**/*.(js|cjs)'],
env: {
mocha: true
},
globals: {
globalThis: false // false means read-only
},
rules: {
'no-console': 'off'
}
},
{
files: ['./**/*.(ts|tsx)'],
rules: {
'no-console': ['error', {allow: ['warn', 'error', 'info', 'debug']}]
}
}
]
}