-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.cjs
138 lines (138 loc) · 4.3 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
135
136
137
138
module.exports = {
ignorePatterns: ['/src/sw.ts'],
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['eslint-plugin-import', 'eslint-plugin-jsdoc', '@typescript-eslint'],
rules: {
'@typescript-eslint/array-type': 'warn',
'@typescript-eslint/consistent-type-assertions': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/dot-notation': 'warn',
'@typescript-eslint/member-delimiter-style': [
'warn',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': [
'warn',
{
hoist: 'all',
},
],
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-namespace-keyword': 'warn',
'@typescript-eslint/quotes': ['warn', 'single'],
'@typescript-eslint/semi': ['warn', 'always'],
'@typescript-eslint/unified-signatures': 'warn',
'arrow-parens': ['warn', 'as-needed'],
eqeqeq: ['warn', 'smart'],
'guard-for-in': 'warn',
'import/order': [
'warn',
{
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
},
],
'jsdoc/check-alignment': 'warn',
'jsdoc/check-indentation': 'warn',
'jsdoc/newline-after-description': 'warn',
'max-len': [
'warn',
{
code: 140,
},
],
'new-parens': 'warn',
'no-bitwise': 'warn',
'no-caller': 'warn',
'no-console': [
'warn',
{
allow: [
'warn',
'dir',
'time',
'timeEnd',
'timeLog',
'trace',
'assert',
'clear',
'count',
'countReset',
'group',
'groupEnd',
'table',
'debug',
'info',
'dirxml',
'error',
'groupCollapsed',
'Console',
'profile',
'profileEnd',
'timeStamp',
'context',
],
},
],
'@typescript-eslint/no-empty-function': 'warn',
'no-eval': 'warn',
'no-new-wrappers': 'warn',
'no-throw-literal': 'warn',
'no-trailing-spaces': 'warn',
'no-undef-init': 'warn',
'no-unused-labels': 'warn',
'no-var': 'warn',
'object-shorthand': 'warn',
'one-var': ['warn', 'never'],
'prefer-const': 'warn',
'no-constant-condition': ['error', { checkLoops: false }],
radix: 'warn',
'spaced-comment': [
'warn',
'always',
{
markers: ['/'],
},
],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
},
};