-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc.js
83 lines (76 loc) · 2.24 KB
/
.eslintrc.js
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-env node */
module.exports = {
extends: [
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
'@react-facet/eslint-config',
'plugin:import/recommended',
'plugin:import/typescript',
],
plugins: ['react', 'require-in-package', 'react-hooks', 'prettier'],
root: true,
env: {
es6: true,
browser: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: './',
project: './tsconfig.json',
},
rules: {
'import/no-cycle': 'error',
'no-unreachable': 'error',
'no-undef': 'error',
eqeqeq: 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'require-in-package/require-in-package': 2,
},
settings: {
'import/extensions': ['.ts', '.tsx'],
'import/resolver': {
typescript: true,
node: true,
},
},
overrides: [
{
files: ['./**/*.{ts,tsx}'],
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/prefer-interface': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullableBoolean: true }],
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variableLike',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'property',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
},
],
},
},
],
}