@luxass/eslint-config 2.2.4 → 2.2.6

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 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": ["error", { beforeColon: false, afterColon: true }],
48
+ "jsonc/key-spacing": [
49
+ "error",
50
+ { beforeColon: false, afterColon: true }
51
+ ],
49
52
  "jsonc/no-octal-escape": "error",
50
- "jsonc/object-curly-newline": ["error", { multiline: true, consistent: true }],
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": ["error", { allowMultiplePropertiesPerLine: true }]
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": ["error", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
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",
@@ -243,19 +256,23 @@ module.exports = {
243
256
  "prefer-spread": "error",
244
257
  "prefer-template": "error",
245
258
  "template-curly-spacing": "error",
246
- "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
259
+ "arrow-parens": ["error", "always"],
247
260
  "generator-star-spacing": "off",
248
- "spaced-comment": ["error", "always", {
249
- line: {
250
- markers: ["/"],
251
- exceptions: ["/", "#"]
252
- },
253
- block: {
254
- markers: ["!"],
255
- exceptions: ["*"],
256
- balanced: true
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",
@@ -271,7 +288,7 @@ module.exports = {
271
288
  "vars-on-top": "error",
272
289
  "require-await": "off",
273
290
  "no-return-assign": "off",
274
- "operator-linebreak": ["error", "before"],
291
+ "operator-linebreak": ["error", "after"],
275
292
  "max-statements-per-line": ["error", { max: 1 }],
276
293
 
277
294
  // unicorns
@@ -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": ["error", { functions: false, classes: false, variables: true }],
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",
@@ -315,7 +335,7 @@ module.exports = {
315
335
  allowSeparatedGroups: false
316
336
  }
317
337
  ],
318
- "yml/quotes": ["error", { prefer: "single", avoidEscape: false }],
338
+ "yml/quotes": ["error", { prefer: "double", avoidEscape: true }],
319
339
  "yml/no-empty-document": "off",
320
340
  "padded-blocks": "off",
321
341
  "no-trailing-spaces": ["error", { skipBlankLines: true }]
package/index.js CHANGED
@@ -3,9 +3,5 @@ const { isPackageExists } = require("local-pkg");
3
3
  const TS = isPackageExists("typescript");
4
4
 
5
5
  module.exports = {
6
- extends: [
7
- TS
8
- ? "./typescript"
9
- : "./basic"
10
- ]
6
+ extends: [TS ? "./typescript" : "./basic"]
11
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "luxass' ESLint config",
5
5
  "author": {
6
6
  "name": "Lucas Norgaard",
@@ -46,13 +46,12 @@
46
46
  "local-pkg": "^0.4.2"
47
47
  },
48
48
  "devDependencies": {
49
- "bumpp": "^8.2.1",
49
+ "@luxass/prettier-config": "^1.1.4",
50
50
  "eslint": "^8.30.0",
51
+ "prettier": "^2.8.1",
51
52
  "typescript": "^4.9.4"
52
53
  },
53
54
  "scripts": {
54
- "bump": "bumpp package.json --commit --push --tag",
55
- "release": "pnpm publish --access public",
56
55
  "lint": "eslint --cache *.js"
57
56
  }
58
57
  }
package/react.js CHANGED
@@ -10,10 +10,7 @@ module.exports = {
10
10
  }
11
11
  },
12
12
  rules: {
13
- "jsx-quotes": [
14
- "error",
15
- "prefer-double"
16
- ],
13
+ "jsx-quotes": ["error", "prefer-double"],
17
14
  "react/react-in-jsx-scope": "off"
18
15
  }
19
16
  };
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": ["error", { "ts-ignore": "allow-with-description" }],
18
- "@typescript-eslint/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
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": ["error", { prefer: "type-imports", disallowTypeAnnotations: false }],
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": ["error", 2, {
26
- SwitchCase: 1,
27
- VariableDeclarator: 1,
28
- outerIIFEBody: 1,
29
- MemberExpression: 1,
30
- FunctionDeclaration: { parameters: 1, body: 1 },
31
- FunctionExpression: { parameters: 1, body: 1 },
32
- CallExpression: { arguments: 1 },
33
- ArrayExpression: 1,
34
- ObjectExpression: 1,
35
- ImportDeclaration: 1,
36
- flatTernaryExpressions: false,
37
- ignoreComments: false,
38
- ignoredNodes: [
39
- "TemplateLiteral *",
40
- "JSXElement",
41
- "JSXElement > *",
42
- "JSXAttribute",
43
- "JSXIdentifier",
44
- "JSXNamespacedName",
45
- "JSXMemberExpression",
46
- "JSXSpreadAttribute",
47
- "JSXExpressionContainer",
48
- "JSXOpeningElement",
49
- "JSXClosingElement",
50
- "JSXFragment",
51
- "JSXOpeningFragment",
52
- "JSXClosingFragment",
53
- "JSXText",
54
- "JSXEmptyExpression",
55
- "JSXSpreadChild",
56
- "TSTypeParameterInstantiation",
57
- "FunctionExpression > .params[decorators.length > 0]",
58
- "FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
59
- "ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
60
- ],
61
- offsetTernaryExpressions: true
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": ["error", { functions: false, classes: false, variables: true }],
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": ["error", { before: true, after: true }],
103
+ "@typescript-eslint/keyword-spacing": [
104
+ "error",
105
+ { before: true, after: true }
106
+ ],
92
107
  "comma-spacing": "off",
93
- "@typescript-eslint/comma-spacing": ["error", { before: false, after: true }],
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": ["error", "always", { exceptAfterSingleLine: true }],
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",