@luxass/eslint-config 2.2.3 → 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.
@@ -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
  {
@@ -181,7 +190,6 @@ module.exports = {
181
190
  "import/no-unresolved": "off",
182
191
  "import/no-absolute-path": "off",
183
192
  "semi": ["warn", "always"],
184
- "curly": ["error", "multi-or-nest", "consistent"],
185
193
  "quotes": ["error", "double"],
186
194
  "quote-props": ["error", "consistent-as-needed"],
187
195
  "no-unused-vars": "warn",
@@ -198,7 +206,11 @@ module.exports = {
198
206
  "no-cond-assign": ["error", "always"],
199
207
  "func-call-spacing": ["off", "never"],
200
208
  "key-spacing": ["error", { beforeColon: false, afterColon: true }],
201
- "indent": ["error", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
209
+ "indent": [
210
+ "error",
211
+ 2,
212
+ { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }
213
+ ],
202
214
  "no-restricted-syntax": [
203
215
  "error",
204
216
  "DebuggerStatement",
@@ -246,17 +258,21 @@ module.exports = {
246
258
  "template-curly-spacing": "error",
247
259
  "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
248
260
  "generator-star-spacing": "off",
249
- "spaced-comment": ["error", "always", {
250
- line: {
251
- markers: ["/"],
252
- exceptions: ["/", "#"]
253
- },
254
- block: {
255
- markers: ["!"],
256
- exceptions: ["*"],
257
- 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
+ }
258
274
  }
259
- }],
275
+ ],
260
276
  "array-callback-return": "error",
261
277
  "block-scoped-var": "error",
262
278
  "consistent-return": "off",
@@ -299,7 +315,10 @@ module.exports = {
299
315
  // Use new when throwing error
300
316
  "unicorn/throw-new-error": "error",
301
317
 
302
- "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
+ ],
303
322
  "eslint-comments/disable-enable-pair": "off",
304
323
  "import/no-named-as-default-member": "off",
305
324
  "import/no-named-as-default": "off",
@@ -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.3",
3
+ "version": "2.2.5",
4
4
  "description": "luxass' ESLint config",
5
5
  "author": {
6
6
  "name": "Lucas Norgaard",
@@ -19,9 +19,9 @@
19
19
  "eslintconfig",
20
20
  "eslint config"
21
21
  ],
22
- "main": "src/index.js",
22
+ "main": "index.js",
23
23
  "files": [
24
- "src"
24
+ "*.js"
25
25
  ],
26
26
  "peerDependencies": {
27
27
  "eslint": "^8.30.0",
@@ -46,13 +46,15 @@
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": {
54
56
  "bump": "bumpp package.json --commit --push --tag",
55
- "release": "pnpm -r publish --access public",
56
- "lint": "eslint --cache src/**/*.js"
57
+ "release": "pnpm publish --access public",
58
+ "lint": "eslint --cache *.js"
57
59
  }
58
60
  }
@@ -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
  };
@@ -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",