-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
109 lines (109 loc) · 3.46 KB
/
eslint.config.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
module.exports = [
{
ignores: [
"node_modules/**/*",
"dist/**/*",
"build/**/*",
"*.js"
],
files: [
"src/**/*.ts",
"webpack.config.js",
],
languageOptions: {
parser: require("@typescript-eslint/parser"),
parserOptions: {
project: "./tsconfig.json",
ecmaVersion: "esnext",
sourceType: "script"
}
},
plugins: {
"@typescript-eslint": require("@typescript-eslint/eslint-plugin"),
"import-newlines": require("eslint-plugin-import-newlines"),
"jsdoc": require("eslint-plugin-jsdoc")
},
rules: {
semi: 'off',
'linebreak-style': ['error', 'unix'],
indent: [
"error",
4,
{
SwitchCase: 1
}
],
"eol-last": ["error", "always"],
"no-multiple-empty-lines": [
"error",
{
max: 1,
maxEOF: 0
}
],
"no-array-constructor": [
"error"
],
quotes: ['error', 'single'],
"object-curly-newline": [
"error",
{
ObjectExpression: {
multiline: true,
minProperties: 1
},
ObjectPattern: {
multiline: true,
minProperties: 1
},
ImportDeclaration: {
multiline: true,
minProperties: 2
},
ExportDeclaration: {
multiline: true,
minProperties: 2
}
}
],
// import-newlines rules
"import-newlines/enforce": [
"error",
{
items: 1
}
],
// jsdoc rules
"jsdoc/require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true,
"FunctionExpression": true,
"ClassExpression": true,
}
}
],
"jsdoc/require-property": "error",
// typescript-eslint rules
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-types": "off", // Disable the rule if not found
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}
],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/triple-slash-reference": "error"
}
}
]