-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.cjs
102 lines (96 loc) · 2.59 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
module.exports = {
env: {
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 2022,
sourceType: `module`,
},
plugins: [`import-quotes`, `import`, `prettier`],
extends: [
`eslint:recommended`,
`plugin:@typescript-eslint/eslint-recommended`,
`plugin:@typescript-eslint/recommended`,
],
rules: {
"prettier/prettier": `warn`,
"no-console": `warn`,
"func-names": `off`,
"no-underscore-dangle": `off`,
"consistent-return": [`error`, { treatUndefinedAsUnspecified: true }],
"jest/expect-expect": `off`,
"security/detect-object-injection": `off`,
// note you must disable the base rule as it can report incorrect errors
"no-unused-vars": `off`,
"@typescript-eslint/no-unused-vars": [`warn`, { argsIgnorePattern: `^_` }],
"import-quotes/import-quotes": [`error`, `double`],
"@typescript-eslint/no-empty-function": `off`,
"import/extensions": [
`error`,
`ignorePackages`,
{
js: `always`,
},
],
"array-callback-return": [
`error`,
{
allowImplicit: true,
checkForEach: true,
},
],
"no-duplicate-imports": `off`,
"@typescript-eslint/no-duplicate-imports": [`error`],
"no-promise-executor-return": `error`,
"no-use-before-define": [`error`, { functions: true, classes: true }],
"require-atomic-updates": `error`,
camelcase: [
`warn`,
{
properties: `never`,
ignoreDestructuring: true,
ignoreImports: true,
ignoreGlobals: false,
allow: [`access_token`, `refresh_token`],
},
],
complexity: `warn`,
"spaced-comment": `error`,
"linebreak-style": [`error`, `unix`],
semi: [`error`, `always`],
quotes: [`error`, `backtick`],
indent: `off`,
"quote-props": [`error`, `as-needed`],
strict: 0,
"comma-dangle": [
`error`,
{
arrays: `always-multiline`,
objects: `always-multiline`,
imports: `always-multiline`,
exports: `always-multiline`,
},
],
"no-trailing-spaces": `error`,
"space-infix-ops": [`error`, { int32Hint: false }],
"eol-last": [`error`, `always`],
"comma-style": [
`error`,
`last`,
{
exceptions: {
ImportDeclaration: true,
},
},
],
// this rule isn't customzied enough
// "sort-imports": [`error`, {
// ignoreCase: true,
// ignoreDeclarationSort: false,
// ignoreMemberSort: false,
// memberSyntaxSortOrder: [`none`, `single`, `all`, `multiple`],
// allowSeparatedGroups: true,
// }],
},
};