-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
120 lines (119 loc) · 3.63 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
const enabled = 'error' // Used to set error level across rules
module.exports = {
env: {
browser: true,
node: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
ecmaVersion: 'latest'
},
plugins: ['react', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
rules: {
'@typescript-eslint/array-type': [enabled, { default: 'array-simple' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-delimiter-style': [
enabled,
{
multiline: {
delimiter: 'none',
requireLast: true
}
}
],
'@typescript-eslint/member-ordering': enabled,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '_' }], // TODO: Enable when vscode format works
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-for-of': enabled,
'@typescript-eslint/prefer-function-type': enabled,
'@typescript-eslint/quotes': [enabled, 'single', { avoidEscape: true }],
'@typescript-eslint/semi': [enabled, 'never'],
'@typescript-eslint/unified-signatures': enabled,
'arrow-body-style': enabled,
'arrow-parens': ['off', 'as-needed'],
'camelcase': 'off',
'constructor-super': enabled,
'dot-notation': enabled,
'guard-for-in': enabled,
'id-blacklist': [enabled, 'any', 'number', 'String', 'string', 'Boolean', 'boolean'],
'id-match': enabled,
'import/no-extraneous-dependencies': 'off',
'import/no-internal-modules': 'off',
'sort-imports': [
enabled,
{
ignoreCase: true,
ignoreDeclarationSort: true,
allowSeparatedGroups: true
}
],
'linebreak-style': [enabled, 'unix'],
'max-classes-per-file': [enabled, 1],
'max-len': [enabled, { code: 140 }],
'new-parens': enabled,
'no-bitwise': enabled,
'no-caller': enabled,
'no-cond-assign': enabled,
'no-console': [enabled, { allow: ['info', 'warn', 'error'] }],
'no-debugger': enabled,
'no-duplicate-case': enabled,
'no-duplicate-imports': enabled,
'no-empty': enabled,
'no-eval': enabled,
'no-extra-bind': enabled,
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-mixed-spaces-and-tabs': 'off', // Not needed with prettier on
'no-multiple-empty-lines': [enabled, { max: 1 }],
'no-new-func': enabled,
'no-new-wrappers': enabled,
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': [enabled],
'no-restricted-imports': [
enabled,
{
paths: [
'lodash', // use `import { x } from 'lodash/fp'` instead
'redux-saga/effects', // use typed-redux-saga
'firebase/database' // use utils/firebase
]
}
],
'no-return-await': enabled,
'no-sequences': enabled,
'no-shadow': 'off', // use typescript version instead
'@typescript-eslint/no-shadow': [enabled, { hoist: 'all' }],
'no-sparse-arrays': enabled,
'no-template-curly-in-string': enabled,
'no-throw-literal': enabled,
'no-trailing-spaces': enabled,
'no-undef-init': enabled,
'no-unsafe-finally': enabled,
'object-shorthand': enabled,
'one-var': [enabled, 'never'],
'prefer-arrow-callback': enabled,
'prefer-object-spread': enabled,
'prefer-template': enabled,
'quote-props': [enabled, 'consistent-as-needed'],
'radix': enabled,
'react/prop-types': 'off',
'space-before-function-paren': [enabled, 'always'],
'space-in-parens': enabled,
'spaced-comment': enabled,
'use-isnan': enabled,
'valid-typeof': 'off'
}
}