/
.eslintrc.js
168 lines (168 loc) · 5.08 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
module.exports = {
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
commonjs: true,
es6: true,
},
globals: {
$: false,
chrome: false,
OpenPGP: false,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/strict', 'plugin:@typescript-eslint/stylistic', 'prettier'],
ignorePatterns: ['.eslintrc.js'],
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: [
'no-only-tests',
'header',
'eslint-plugin-jsdoc',
'eslint-plugin-prefer-arrow',
'eslint-plugin-import',
'eslint-plugin-no-null',
'eslint-plugin-local-rules',
'@typescript-eslint',
],
root: true,
rules: {
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: ['classProperty', 'objectLiteralProperty', 'typeProperty', 'classMethod', 'objectLiteralMethod', 'typeMethod', 'accessor', 'enumMember'],
format: null,
modifiers: ['requiresQuotes'],
},
{
selector: ['classProperty'],
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: ['import'],
format: ['camelCase', 'PascalCase'],
},
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': ['warn'],
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
'@typescript-eslint/unified-signatures': 'error',
complexity: 'off',
'constructor-super': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'header/header': ['error', 'block', ' ©️ 2016 - present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com '],
'id-denylist': 'error',
'id-match': 'error',
'import/order': 'off',
'jsdoc/check-alignment': 'off',
'jsdoc/check-indentation': 'off',
'jsdoc/newline-after-description': 'off',
'max-classes-per-file': 'off',
'no-bitwise': 'off',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-constant-condition': 0,
'no-control-regex': 0,
'no-debugger': 'error',
'no-empty': 'error',
'no-empty-pattern': 0,
'no-eval': 'error',
'no-fallthrough': 0,
'no-invalid-this': 'off',
'no-new-wrappers': 'error',
'no-null/no-null': 'error',
'no-only-tests/no-only-tests': ['error'],
'no-prototype-builtins': 0,
'no-shadow': 'off',
'no-throw-literal': 'error',
'no-undef': 0,
'no-undef-init': 'error',
'no-underscore-dangle': 'error',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-use-before-define': 'off',
'no-useless-escape': 0,
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['off', 'never'],
'prefer-arrow/prefer-arrow-functions': 'error',
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
radix: 'off',
'require-atomic-updates': 0,
'sort-imports': 'off',
'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
'local-rules/standard-loops': 'error',
},
overrides: [
{
files: './test/**/*.ts',
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
],
};