This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy path.eslintrc.js
93 lines (92 loc) · 2.36 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
/* eslint-env node */
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:jsx-a11y/recommended',
'prettier',
'prettier/react',
],
parser: 'babel-eslint',
plugins: ['jest', 'react-hooks', 'simple-import-sort', 'prettier'],
env: {
node: true,
browser: true,
es6: true,
},
root: true,
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.ios.js', '.android.js'],
},
},
},
overrides: [
{
files: ['*.spec.js', '*.spec.ts', '*.spec.tsx', '*.test.js', '*.test.ts', '*.test.tsx'],
env: {
node: true,
browser: true,
'jest/globals': true,
},
},
],
rules: {
'prettier/prettier': [
'error',
{
trailingComma: 'es5',
singleQuote: true,
printWidth: 100,
semi: true,
},
],
'no-console': [
'error',
{
allow: ['warn', 'error', 'info', 'debug'],
},
],
'prefer-destructuring': [
'error',
{
array: false,
object: true,
},
],
curly: 'error',
'dot-notation': 'error',
'no-await-in-loop': 'error',
'no-duplicate-imports': 'error',
'no-implicit-coercion': 'error',
'no-nested-ternary': 'error',
'no-param-reassign': 'error',
'no-unused-vars': [
'error',
{ args: 'after-used', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'no-use-before-define': ['error', { variables: true, functions: false, classes: true }],
'prefer-const': 'error',
'prefer-template': 'error',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.tsx'] }],
'react/self-closing-comp': 'error',
'simple-import-sort/sort': 'error',
'object-shorthand': 'error',
// Rules that doesn't make sense:
'jest/no-standalone-expect': 'off', // afterEach not covered
'import/prefer-default-export': 'off',
'import/named': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'sort-imports': 'off', // replaced by simple-import-sort/sort
'import/order': 'off', // replaced by simple-import-sort/sort
},
};