-
Notifications
You must be signed in to change notification settings - Fork 22
/
.eslintrc.js
145 lines (145 loc) · 5.2 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
module.exports = {
'parser': '@typescript-eslint/parser',
'plugins': [
'@typescript-eslint'
],
'env': {
'es2020': true,
'browser': true,
'commonjs': true,
// 'es6': true,
'node': true,
'mocha': true
},
'parserOptions': {
'ecmaFeatures': {'jsx': true},
'sourceType': 'module'
},
'globals': {
'window': true,
'describe': true,
'it': true,
'beforeEach': true,
'b_vite': true,
'$vite_docs': true
},
'extends': [
'eslint:recommended',
'eslint-config-alloy/typescript'
],
'rules': {
'guard-for-in': 'off',
'no-throw-literal': 'off',
'prefer-promise-reject-errors': 'off',
'eqeqeq': [ 'error', 'smart' ],
'no-else-return': 'error',
'no-labels': 'error',
'no-return-assign': 'error',
'no-multi-spaces': 'error',
'no-param-reassign': 'warn',
'indent': [ 'error', 4 ],
'linebreak-style': [ 'error', 'unix' ],
'quotes': [ 'error', 'single' ],
'semi': [ 'error', 'always' ],
'no-console': 'off',
'no-useless-escape': 'off',
'no-debugger': 'warn',
'array-bracket-spacing': [ 'error', 'always', {
'singleValue': false,
'arraysInArrays': false
} ],
'brace-style': 'error',
'comma-dangle': [ 'error', 'never' ],
'comma-spacing': [ 'error', {
'before': false,
'after': true
} ],
'comma-style': [ 'error', 'last' ],
'eol-last': [ 'error', 'always' ],
'func-call-spacing': [ 'error', 'never' ],
'function-paren-newline': [ 'error', 'never' ],
'key-spacing': [ 'error', {
'beforeColon': false,
'afterColon': true,
'mode': 'strict'
} ],
'keyword-spacing': [ 'error', {
'before': true,
'after': true
} ],
'lines-between-class-members': [ 'error', 'always', {'exceptAfterSingleLine': true} ],
'max-depth': [ 'error', 4 ],
'max-nested-callbacks': [ 'error', 5 ],
'max-statements-per-line': [ 'error', {'max': 1} ],
'newline-per-chained-call': [ 'error', { 'ignoreChainWithDepth': 3 } ],
'no-lonely-if': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': 'error',
'no-negated-condition': 'error',
'no-tabs': 'error',
'no-trailing-spaces': 'error',
'no-unneeded-ternary': 'error',
'no-whitespace-before-property': 'error',
'nonblock-statement-body-position': [ 'error', 'beside' ],
'object-curly-newline': [ 'error', {'multiline': true} ],
'object-property-newline': [ 'error', {'allowAllPropertiesOnSameLine': true} ],
'operator-linebreak': [ 'error', 'before' ],
'padded-blocks': [ 'error', 'never' ],
'padding-line-between-statements': [ 'error',
{ 'blankLine': 'always', 'prev': 'block', 'next': '*' },
{ 'blankLine': 'always', 'prev': 'directive', 'next': '*' }
],
'semi-style': [ 'error', 'last' ],
'space-before-blocks': 'error',
'space-before-function-paren': [ 'error', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always'
} ],
'space-in-parens': [ 'error', 'never' ],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': [ 'error', 'always' ],
'switch-colon-spacing': 'error',
'template-tag-spacing': 'error',
'arrow-body-style': [ 'error', 'as-needed', {'requireReturnForObjectLiteral': true} ],
'arrow-parens': [ 'error', 'as-needed' ],
'arrow-spacing': 'error',
'constructor-super': 'error',
'generator-star-spacing': [ 'error', {
'before': true,
'after': false
} ],
'no-confusing-arrow': 'warn',
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'warn',
'no-var': 'error',
'no-useless-rename': 'error',
'prefer-const': 'warn',
'prefer-template': 'error',
'rest-spread-spacing': [ 'error', 'never' ],
'yield-star-spacing': [ 'error', 'before' ],
'template-curly-spacing': [ 'error', 'always' ],
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'no-irregular-whitespace': [ 'error', {
'skipStrings': true,
'skipComments': true,
'skipRegExps': true,
'skipTemplates': true
} ],
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-optional-chain': 'off'
// "require-jsdoc": ["error", {
// "require": {
// "FunctionDeclaration": true,
// "MethodDefinition": true,
// "ClassDeclaration": true
// }
// }]
// "new-cap": ["error", { "capIsNew": true }]
}
};