-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
134 lines (134 loc) · 3.47 KB
/
.eslintrc.cjs
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
127
128
129
130
131
132
133
134
module.exports = {
extends: ['eslint:recommended', 'prettier', './eslint-typescript.cjs'],
plugins: ['prettier', 'import'],
env: {
es6: true,
browser: true,
},
settings: {
'import/ignore': ['node_modules'],
},
globals: {
process: 'readonly',
},
rules: {
'no-restricted-globals': [
'error',
{
name: 'fdescribe',
message: 'Do not commit "fdescribe". Use "describe" instead.',
},
{
name: 'fit',
message: 'Do not commit "fit". Use "it" instead.',
},
],
'no-restricted-properties': [
'error',
{
object: 'describe',
property: 'only',
message: 'Do not commit "describe.only". Use "describe" instead.',
},
{
object: 'it',
property: 'only',
message: 'Do not commit "it.only". Use "it" instead.',
},
],
'prettier/prettier': ['error'],
'import/first': ['error'],
'import/no-cycle': ['error'],
camelcase: [
'error',
{
allow: [
'^UNSAFE_',
'^LEGACY_',
'^DANGEROUS_',
'^DEPRECATED_',
'^__DS_ONLY_',
],
},
],
'arrow-spacing': ['error'],
'block-scoped-var': ['off'],
'dot-notation': ['error'],
'func-call-spacing': ['off'],
'new-parens': ['error'],
'no-array-constructor': ['error'],
'no-console': ['error'],
'no-debugger': ['error'],
'no-empty': ['error'],
'no-constant-condition': ['error', { checkLoops: false }],
'no-irregular-whitespace': ['error', { skipTemplates: true }],
'no-label-var': ['error'],
'no-lonely-if': ['error'],
'no-new-object': ['error'],
'no-param-reassign': ['error'],
'no-redeclare': ['error'],
'no-return-assign': ['error'],
'no-self-compare': ['error'],
'no-shadow-restricted-names': ['error'],
'no-trailing-spaces': ['error'],
'no-undef-init': ['error'],
'no-unneeded-ternary': ['error'],
'no-useless-call': ['error'],
'no-useless-escape': ['error'],
'no-void': ['error'],
radix: ['error'],
strict: ['error', 'never'],
eqeqeq: ['error', 'always'],
'spaced-comment': ['error', 'always'],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
},
],
'no-shadow': 'off', // https://typescript-eslint.io/rules/no-shadow
'padded-blocks': ['error', 'never'],
'no-unused-expressions': ['error'],
'prefer-template': ['error'],
'no-else-return': ['error'],
'class-methods-use-this': [
'error',
{
exceptMethods: [
'componentDidMount',
'componentDidUpdate',
'componentWillMount',
'componentWillReceiveProps',
'componentWillUnmount',
'componentWillUpdate',
'render',
'shouldComponentUpdate',
],
},
],
'sort-imports': ['warn', { ignoreDeclarationSort: true }],
'no-restricted-imports': ['error', { patterns: ['rxbeach', 'rxbeach/*'] }],
'func-style': ['error', 'expression'],
},
overrides: [
{
files: ['*.tspec.ts'],
env: {
mocha: true,
node: true,
},
rules: {
'@typescript-eslint/no-unused-vars': ['off'],
camelcase: ['off'],
'prefer-const': ['off'],
},
},
{
files: ['.eslintrc.js', 'eslint-typescript.js'],
env: { node: true },
},
],
};