@luxass/eslint-config 2.2.4 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/basic.js +35 -15
- package/index.js +1 -5
- package/package.json +3 -1
- package/react.js +1 -4
- package/typescript.js +67 -45
package/basic.js
CHANGED
|
@@ -45,11 +45,20 @@ module.exports = {
|
|
|
45
45
|
"jsonc/comma-dangle": ["error", "never"],
|
|
46
46
|
"jsonc/comma-style": ["error", "last"],
|
|
47
47
|
"jsonc/indent": ["error", 2],
|
|
48
|
-
"jsonc/key-spacing": [
|
|
48
|
+
"jsonc/key-spacing": [
|
|
49
|
+
"error",
|
|
50
|
+
{ beforeColon: false, afterColon: true }
|
|
51
|
+
],
|
|
49
52
|
"jsonc/no-octal-escape": "error",
|
|
50
|
-
"jsonc/object-curly-newline": [
|
|
53
|
+
"jsonc/object-curly-newline": [
|
|
54
|
+
"error",
|
|
55
|
+
{ multiline: true, consistent: true }
|
|
56
|
+
],
|
|
51
57
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
52
|
-
"jsonc/object-property-newline": [
|
|
58
|
+
"jsonc/object-property-newline": [
|
|
59
|
+
"error",
|
|
60
|
+
{ allowMultiplePropertiesPerLine: true }
|
|
61
|
+
]
|
|
53
62
|
}
|
|
54
63
|
},
|
|
55
64
|
{
|
|
@@ -197,7 +206,11 @@ module.exports = {
|
|
|
197
206
|
"no-cond-assign": ["error", "always"],
|
|
198
207
|
"func-call-spacing": ["off", "never"],
|
|
199
208
|
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
200
|
-
"indent": [
|
|
209
|
+
"indent": [
|
|
210
|
+
"error",
|
|
211
|
+
2,
|
|
212
|
+
{ SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }
|
|
213
|
+
],
|
|
201
214
|
"no-restricted-syntax": [
|
|
202
215
|
"error",
|
|
203
216
|
"DebuggerStatement",
|
|
@@ -245,17 +258,21 @@ module.exports = {
|
|
|
245
258
|
"template-curly-spacing": "error",
|
|
246
259
|
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
|
|
247
260
|
"generator-star-spacing": "off",
|
|
248
|
-
"spaced-comment": [
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
261
|
+
"spaced-comment": [
|
|
262
|
+
"error",
|
|
263
|
+
"always",
|
|
264
|
+
{
|
|
265
|
+
line: {
|
|
266
|
+
markers: ["/"],
|
|
267
|
+
exceptions: ["/", "#"]
|
|
268
|
+
},
|
|
269
|
+
block: {
|
|
270
|
+
markers: ["!"],
|
|
271
|
+
exceptions: ["*"],
|
|
272
|
+
balanced: true
|
|
273
|
+
}
|
|
257
274
|
}
|
|
258
|
-
|
|
275
|
+
],
|
|
259
276
|
"array-callback-return": "error",
|
|
260
277
|
"block-scoped-var": "error",
|
|
261
278
|
"consistent-return": "off",
|
|
@@ -298,7 +315,10 @@ module.exports = {
|
|
|
298
315
|
// Use new when throwing error
|
|
299
316
|
"unicorn/throw-new-error": "error",
|
|
300
317
|
|
|
301
|
-
"no-use-before-define": [
|
|
318
|
+
"no-use-before-define": [
|
|
319
|
+
"error",
|
|
320
|
+
{ functions: false, classes: false, variables: true }
|
|
321
|
+
],
|
|
302
322
|
"eslint-comments/disable-enable-pair": "off",
|
|
303
323
|
"import/no-named-as-default-member": "off",
|
|
304
324
|
"import/no-named-as-default": "off",
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "luxass' ESLint config",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Lucas Norgaard",
|
|
@@ -46,8 +46,10 @@
|
|
|
46
46
|
"local-pkg": "^0.4.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@luxass/prettier-config": "^1.1.1",
|
|
49
50
|
"bumpp": "^8.2.1",
|
|
50
51
|
"eslint": "^8.30.0",
|
|
52
|
+
"prettier": "^2.8.1",
|
|
51
53
|
"typescript": "^4.9.4"
|
|
52
54
|
},
|
|
53
55
|
"scripts": {
|
package/react.js
CHANGED
package/typescript.js
CHANGED
|
@@ -14,58 +14,70 @@ module.exports = {
|
|
|
14
14
|
overrides: basic.overrides,
|
|
15
15
|
rules: {
|
|
16
16
|
"import/named": "off",
|
|
17
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
18
|
-
|
|
17
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
18
|
+
"error",
|
|
19
|
+
{ "ts-ignore": "allow-with-description" }
|
|
20
|
+
],
|
|
19
21
|
"@typescript-eslint/type-annotation-spacing": ["error", {}],
|
|
20
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
22
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
23
|
+
"error",
|
|
24
|
+
{ prefer: "type-imports", disallowTypeAnnotations: false }
|
|
25
|
+
],
|
|
21
26
|
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
22
27
|
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
23
28
|
"no-useless-constructor": "off",
|
|
24
29
|
"indent": "off",
|
|
25
|
-
"@typescript-eslint/indent": [
|
|
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
|
-
|
|
30
|
+
"@typescript-eslint/indent": [
|
|
31
|
+
"error",
|
|
32
|
+
2,
|
|
33
|
+
{
|
|
34
|
+
SwitchCase: 1,
|
|
35
|
+
VariableDeclarator: 1,
|
|
36
|
+
outerIIFEBody: 1,
|
|
37
|
+
MemberExpression: 1,
|
|
38
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
39
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
40
|
+
CallExpression: { arguments: 1 },
|
|
41
|
+
ArrayExpression: 1,
|
|
42
|
+
ObjectExpression: 1,
|
|
43
|
+
ImportDeclaration: 1,
|
|
44
|
+
flatTernaryExpressions: false,
|
|
45
|
+
ignoreComments: false,
|
|
46
|
+
ignoredNodes: [
|
|
47
|
+
"TemplateLiteral *",
|
|
48
|
+
"JSXElement",
|
|
49
|
+
"JSXElement > *",
|
|
50
|
+
"JSXAttribute",
|
|
51
|
+
"JSXIdentifier",
|
|
52
|
+
"JSXNamespacedName",
|
|
53
|
+
"JSXMemberExpression",
|
|
54
|
+
"JSXSpreadAttribute",
|
|
55
|
+
"JSXExpressionContainer",
|
|
56
|
+
"JSXOpeningElement",
|
|
57
|
+
"JSXClosingElement",
|
|
58
|
+
"JSXFragment",
|
|
59
|
+
"JSXOpeningFragment",
|
|
60
|
+
"JSXClosingFragment",
|
|
61
|
+
"JSXText",
|
|
62
|
+
"JSXEmptyExpression",
|
|
63
|
+
"JSXSpreadChild",
|
|
64
|
+
"TSTypeParameterInstantiation",
|
|
65
|
+
"FunctionExpression > .params[decorators.length > 0]",
|
|
66
|
+
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
|
|
67
|
+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
|
|
68
|
+
],
|
|
69
|
+
offsetTernaryExpressions: true
|
|
70
|
+
}
|
|
71
|
+
],
|
|
63
72
|
"no-unused-vars": "off",
|
|
64
73
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
65
74
|
"no-redeclare": "off",
|
|
66
75
|
"@typescript-eslint/no-redeclare": "error",
|
|
67
76
|
"no-use-before-define": "off",
|
|
68
|
-
"@typescript-eslint/no-use-before-define": [
|
|
77
|
+
"@typescript-eslint/no-use-before-define": [
|
|
78
|
+
"error",
|
|
79
|
+
{ functions: false, classes: false, variables: true }
|
|
80
|
+
],
|
|
69
81
|
"comma-dangle": "off",
|
|
70
82
|
"@typescript-eslint/comma-dangle": ["error", "never"],
|
|
71
83
|
"object-curly-spacing": "off",
|
|
@@ -88,9 +100,15 @@ module.exports = {
|
|
|
88
100
|
"space-infix-ops": "off",
|
|
89
101
|
"@typescript-eslint/space-infix-ops": "error",
|
|
90
102
|
"keyword-spacing": "off",
|
|
91
|
-
"@typescript-eslint/keyword-spacing": [
|
|
103
|
+
"@typescript-eslint/keyword-spacing": [
|
|
104
|
+
"error",
|
|
105
|
+
{ before: true, after: true }
|
|
106
|
+
],
|
|
92
107
|
"comma-spacing": "off",
|
|
93
|
-
"@typescript-eslint/comma-spacing": [
|
|
108
|
+
"@typescript-eslint/comma-spacing": [
|
|
109
|
+
"error",
|
|
110
|
+
{ before: false, after: true }
|
|
111
|
+
],
|
|
94
112
|
"no-extra-parens": "off",
|
|
95
113
|
"@typescript-eslint/no-extra-parens": ["error", "functions"],
|
|
96
114
|
"no-dupe-class-members": "off",
|
|
@@ -98,7 +116,11 @@ module.exports = {
|
|
|
98
116
|
"no-loss-of-precision": "off",
|
|
99
117
|
"@typescript-eslint/no-loss-of-precision": "error",
|
|
100
118
|
"lines-between-class-members": "off",
|
|
101
|
-
"@typescript-eslint/lines-between-class-members": [
|
|
119
|
+
"@typescript-eslint/lines-between-class-members": [
|
|
120
|
+
"error",
|
|
121
|
+
"always",
|
|
122
|
+
{ exceptAfterSingleLine: true }
|
|
123
|
+
],
|
|
102
124
|
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
103
125
|
"@typescript-eslint/naming-convention": "off",
|
|
104
126
|
"@typescript-eslint/explicit-function-return-type": "off",
|