-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
69 lines (61 loc) · 1.69 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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: 'xo',
overrides: [
{
extends: [
'xo-typescript',
],
files: [
'*.ts',
'*.tsx',
],
rules: {
// Enforces no semicolons
semi: 'off',
'@typescript-eslint/semi': ['error', 'never'],
// Turns off "readonly" enforcing in classes
'@typescript-eslint/prefer-readonly': 'off',
// Enforces all class members (except constructor) to explicitly indicate their accessibility
'@typescript-eslint/explicit-member-accessibility': ['error', {
accessibility: 'explicit',
overrides: {
constructors: 'no-public',
},
}],
// Enforces functions to explicitly indicate their return type
'@typescript-eslint/explicit-function-return-type': 'error',
// Enforces explicit type definitions over inferred types
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/typedef': ['error', {
arrayDestructuring: true,
arrowParameter: true,
memberVariableDeclaration: true,
objectDestructuring: true,
parameter: true,
propertyDeclaration: true,
variableDeclaration: true,
variableDeclarationIgnoreFunction: true,
}],
// Allows extraneous empty or static classes
'@typescript-eslint/no-extraneous-class': 'off',
// Allows empty functions
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
// Allows up to 10 nested callbacks
'max-nested-callbacks': ['error', 10],
// Allows useless constructors
'@typescript-eslint/no-useless-constructor': 'off',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {},
};