-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
88 lines (88 loc) · 2.09 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
module.exports = {
parser: '@babel/eslint-parser',
plugins: [
'import',
'prettier',
'react',
'react-hooks',
'compat',
'jest',
'json',
],
extends: [
// 'airbnb',
'airbnb-base',
'prettier',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:import/recommended',
],
globals: {
document: 'readonly',
window: 'readonly',
ResizeObserver: 'readonly',
},
rules: {
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'error',
// Since React 17 and typescript 4.1 you can safely disable the rule
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'no-param-reassign': 'off',
'no-shadow': 'off',
'dot-notation': 'off',
camelcase: 'off',
'no-else-return': 'off',
'consistent-return': 'off',
'no-nested-ternary': 'off',
'prefer-destructuring': 'off',
'no-unused-expressions': 'off',
'no-promise-executor-return': 'off',
'func-names': 'off',
'default-param-last': 'off',
'no-unneeded-ternary': 'off',
'class-methods-use-this': 'off',
'no-continue': 'off',
'no-underscore-dangle': 'off',
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'import/no-self-import': 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'off',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './babel.config.js',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
ecmaFeatures: {
jsx: true,
modules: true,
},
},
settings: {
'import/resolver': {
// See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
node: {
extensions: ['.js', '.jsx', '.json'],
},
webpack: {
config: require.resolve(
'./.erb/configs/webpack.config.eslint.js',
),
},
react: {
version: 'detect',
},
typescript: {},
},
// 'import/parsers': {
// '@babel/eslint-parser': ['.js', '.jsx', '.json'],
// },
},
};