-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
92 lines (92 loc) · 2.47 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
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jasmine: true,
jest: true,
},
extends: [
'@redhat-cloud-services/eslint-config-redhat-cloud-services',
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
comment: true,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2017,
extraFileExtensions: ['.json'],
sourceType: 'module',
tsconfigRootDir: './',
},
plugins: ['react', 'react-hooks', '@typescript-eslint'],
rules: {
camelcase: [
'error',
{ allow: ['UNSAFE_componentWillReceiveProps', 'UNSAFE_componentWillMount'] },
],
'consistent-return': 0,
'consistent-this': [1, 'that'],
'default-case': [2],
'dot-notation': [2],
eqeqeq: [2, 'allow-null'],
'guard-for-in': 2,
'import/no-duplicates': ['error'],
'max-nested-callbacks': [1, 4],
'no-alert': 2,
'no-caller': 2,
'no-console': 2,
'no-else-return': ['error'],
'no-global-strict': 0,
'no-restricted-imports': ['error',
{
name: '@patternfly/react-icons',
message: 'Don\'t use group imports. Use @patternfly/react-icons/dist/js/icons/(kebab-case-name) instead.'
},
{
name: 'lodash',
message: 'Don\'t use group imports. Use lodash/(funcName) instead.'
}
],
'no-shadow': ['error'],
'no-underscore-dangle': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: 'React', args: 'after-used' },
],
'@typescript-eslint/no-use-before-define': 2,
'no-var': 2,
'object-shorthand': ['error', 'properties'],
'prefer-const': ['error', { destructuring: 'all' }],
'prefer-template': 2,
radix: 2,
'react/display-name': 0,
'react/prop-types': 0,
'react/self-closing-comp': 2,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'require-atomic-updates': 0,
},
settings: {
'import/extensions': ['.js', '.jsx'],
'import/resolver': {
node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
typescript: {},
},
},
globals: {
process: 'readonly',
global: 'readonly',
// FIXME: Promise.allSettled() has types that eslint does not recognize
PromiseSettledResult: 'readonly',
PromiseFulfilledResult: 'readonly',
},
};