-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
126 lines (126 loc) · 3.2 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
module.exports = {
env: {
commonjs: true,
es6: true,
jest: true,
node: true,
},
extends: ['airbnb-typescript', 'prettier', 'plugin:monorepo-cop/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: [
'react',
'react-hooks',
'import',
'@typescript-eslint',
'es',
'monorepo-cop',
'deprecation',
'no-only-tests',
],
rules: {
'@typescript-eslint/array-type': [
'error',
{
default: 'array',
},
],
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-redeclare': ['error'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
{
selector: 'typeLike',
format: ['PascalCase', 'UPPER_CASE'],
},
{
selector: 'enum',
format: ['PascalCase', 'UPPER_CASE'],
},
],
'arrow-body-style': 'off',
'consistent-return': 'off',
curly: ['error', 'all'],
'import/export': 2,
// Provided by TS
'import/named': 'off',
'import/default': 'off',
'import/namespace': 'off',
'import/order': [
'error',
{
groups: [['builtin', 'external']],
},
],
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-mutable-exports': 'off',
'import/no-unresolved': [
2,
{
amd: true,
commonjs: true,
},
],
'import/prefer-default-export': 'off',
'no-redeclare': 'off',
'no-await-in-loop': 'off',
'no-bitwise': 'off',
'no-console': 'warn',
'no-continue': 'off',
'no-nested-ternary': 'warn',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-shadow': 'off',
'no-void': [2, { allowAsStatement: true }],
'react-hooks/rules-of-hooks': 'error',
'react/display-name': 'warn',
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx', '.tsx'],
},
],
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'warn',
'react/require-default-props': 'off',
/*
* next two rules "off" because of the new JSX transform that
* came with React 17
*/
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'es/no-regexp-lookbehind-assertions': 'error',
'deprecation/deprecation': 'warn',
'no-only-tests/no-only-tests': 'error',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
};