@luxass/eslint-config 2.1.1 → 2.2.1

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @luxass/eslint-config
2
2
 
3
+ > A shareable ESLINT Config based on [@antfu/eslint-config](https://github.com/antfu/eslint-config)
4
+
3
5
  ## Installation
4
6
 
5
7
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "luxass' ESLint config",
5
5
  "author": {
6
6
  "name": "Lucas Norgaard",
@@ -16,34 +16,38 @@
16
16
  "eslint-config",
17
17
  "eslint",
18
18
  "config",
19
- "eslintconfig"
19
+ "eslintconfig",
20
+ "eslint config"
20
21
  ],
21
22
  "main": "src/index.js",
22
23
  "files": [
23
24
  "src"
24
25
  ],
25
26
  "peerDependencies": {
26
- "eslint": "^8.29.0",
27
+ "eslint": "^8.30.0",
27
28
  "typescript": "^4.9.4"
28
29
  },
29
30
  "dependencies": {
30
- "@typescript-eslint/eslint-plugin": "^5.46.0",
31
- "@typescript-eslint/parser": "^5.46.0",
31
+ "@typescript-eslint/eslint-plugin": "^5.46.1",
32
+ "@typescript-eslint/parser": "^5.46.1",
32
33
  "eslint-config-standard": "^17.0.0",
33
34
  "eslint-plugin-eslint-comments": "^3.2.0",
35
+ "eslint-plugin-html": "^7.1.0",
34
36
  "eslint-plugin-import": "^2.26.0",
35
37
  "eslint-plugin-jsonc": "^2.5.0",
36
38
  "eslint-plugin-markdown": "^3.0.0",
37
39
  "eslint-plugin-n": "^15.6.0",
38
40
  "eslint-plugin-promise": "^6.1.1",
39
41
  "eslint-plugin-react": "^7.31.11",
40
- "eslint-plugin-unicorn": "^45.0.1",
42
+ "eslint-plugin-react-hooks": "^4.6.0",
43
+ "eslint-plugin-unicorn": "^45.0.2",
41
44
  "eslint-plugin-yml": "^1.3.0",
42
- "jsonc-eslint-parser": "^2.1.0"
45
+ "jsonc-eslint-parser": "^2.1.0",
46
+ "local-pkg": "^0.4.2"
43
47
  },
44
48
  "devDependencies": {
45
49
  "bumpp": "^8.2.1",
46
- "eslint": "^8.29.0",
50
+ "eslint": "^8.30.0",
47
51
  "typescript": "^4.9.4"
48
52
  },
49
53
  "scripts": {
package/src/basic.js ADDED
@@ -0,0 +1,316 @@
1
+ module.exports = {
2
+ env: {
3
+ es6: true,
4
+ browser: true,
5
+ node: true
6
+ },
7
+ reportUnusedDisableDirectives: true,
8
+ extends: [
9
+ "eslint-config-standard",
10
+ "plugin:import/recommended",
11
+ "plugin:eslint-comments/recommended",
12
+ "plugin:jsonc/recommended-with-jsonc",
13
+ "plugin:yml/standard",
14
+ "plugin:markdown/recommended"
15
+ ],
16
+ ignorePatterns: [
17
+ "*.min.*",
18
+ "*.d.ts",
19
+ "CHANGELOG.md",
20
+ "dist",
21
+ "build",
22
+ "out",
23
+ "output",
24
+ "LICENSE*",
25
+ "coverage",
26
+ "public",
27
+ "package-lock.json",
28
+ "pnpm-lock.yaml",
29
+ "yarn.lock",
30
+ "!.github",
31
+ "!.vscode"
32
+ ],
33
+ plugins: ["html", "unicorn"],
34
+ settings: {
35
+ "import/resolver": {
36
+ node: { extensions: [".js", ".mjs"] }
37
+ }
38
+ },
39
+ overrides: [
40
+ {
41
+ files: ["*.json", "*.json5"],
42
+ parser: "jsonc-eslint-parser",
43
+ rules: {
44
+ "jsonc/array-bracket-spacing": ["error", "never"],
45
+ "jsonc/comma-dangle": ["error", "never"],
46
+ "jsonc/comma-style": ["error", "last"],
47
+ "jsonc/indent": ["error", 2],
48
+ "jsonc/key-spacing": ["error", { beforeColon: false, afterColon: true }],
49
+ "jsonc/no-octal-escape": "error",
50
+ "jsonc/object-curly-newline": ["error", { multiline: true, consistent: true }],
51
+ "jsonc/object-curly-spacing": ["error", "always"],
52
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }]
53
+ }
54
+ },
55
+ {
56
+ files: ["*.yaml", "*.yml"],
57
+ parser: "yaml-eslint-parser",
58
+ rules: {
59
+ "spaced-comment": "off"
60
+ }
61
+ },
62
+ {
63
+ files: ["package.json"],
64
+ parser: "jsonc-eslint-parser",
65
+ rules: {
66
+ "jsonc/sort-keys": [
67
+ "error",
68
+ {
69
+ pathPattern: "^$",
70
+ order: [
71
+ "name",
72
+ "publisher",
73
+ "displayName",
74
+ "type",
75
+ "version",
76
+ "private",
77
+ "description",
78
+ "author",
79
+ "license",
80
+ "funding",
81
+ "homepage",
82
+ "repository",
83
+ "bugs",
84
+ "keywords",
85
+ "categories",
86
+ "sideEffects",
87
+ "exports",
88
+ "main",
89
+ "module",
90
+ "types",
91
+ "typesVersions",
92
+ "bin",
93
+ "icon",
94
+ "files",
95
+ "engines",
96
+ "packageManager",
97
+ "activationEvents",
98
+ "contributes",
99
+ "scripts",
100
+ "peerDependencies",
101
+ "peerDependenciesMeta",
102
+ "dependencies",
103
+ "optionalDependencies",
104
+ "devDependencies",
105
+ "pnpm",
106
+ "overrides",
107
+ "resolutions",
108
+ "eslintConfig"
109
+ ]
110
+ },
111
+ {
112
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
113
+ order: { type: "asc" }
114
+ },
115
+ {
116
+ pathPattern: "^exports.*$",
117
+ order: ["types", "require", "import"]
118
+ }
119
+ ]
120
+ }
121
+ },
122
+ {
123
+ files: ["*.d.ts"],
124
+ rules: {
125
+ "import/no-duplicates": "off"
126
+ }
127
+ },
128
+ {
129
+ files: ["*.js"],
130
+ rules: {
131
+ "@typescript-eslint/no-var-requires": "off"
132
+ }
133
+ },
134
+ {
135
+ files: ["*.ts", "*.tsx", "*.mts", "*.cts"],
136
+ rules: {
137
+ "no-void": ["error", { allowAsStatement: true }]
138
+ }
139
+ },
140
+ {
141
+ files: ["scripts/**/*.*", "cli.*"],
142
+ rules: {
143
+ "no-console": "off"
144
+ }
145
+ },
146
+ {
147
+ files: ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
148
+ rules: {
149
+ "no-unused-expressions": "off"
150
+ }
151
+ },
152
+ {
153
+ files: ["**/*.md/*.*"],
154
+ rules: {
155
+ "@typescript-eslint/no-redeclare": "off",
156
+ "@typescript-eslint/no-unused-vars": "off",
157
+ "@typescript-eslint/no-use-before-define": "off",
158
+ "@typescript-eslint/no-var-requires": "off",
159
+ "@typescript-eslint/comma-dangle": "off",
160
+ "@typescript-eslint/consistent-type-imports": "off",
161
+ "import/no-unresolved": "off",
162
+ "no-alert": "off",
163
+ "no-console": "off",
164
+ "no-restricted-imports": "off",
165
+ "no-undef": "off",
166
+ "no-unused-expressions": "off",
167
+ "no-unused-vars": "off"
168
+ }
169
+ }
170
+ ],
171
+ rules: {
172
+ "import/order": "error",
173
+ "import/first": "error",
174
+ "import/no-mutable-exports": "error",
175
+ "import/no-unresolved": "off",
176
+ "import/no-absolute-path": "off",
177
+ "semi": ["warn", "always"],
178
+ "curly": ["error", "multi-or-nest", "consistent"],
179
+ "quotes": ["error", "double"],
180
+ "quote-props": ["error", "consistent-as-needed"],
181
+ "no-unused-vars": "warn",
182
+ "no-param-reassign": "off",
183
+ "array-bracket-spacing": ["error", "never"],
184
+ "brace-style": ["error", "stroustrup", { allowSingleLine: true }],
185
+ "block-spacing": ["error", "always"],
186
+ "camelcase": "off",
187
+ "comma-spacing": ["error", { before: false, after: true }],
188
+ "comma-style": ["error", "last"],
189
+ "comma-dangle": ["error", "never"],
190
+ "no-constant-condition": "warn",
191
+ "no-debugger": "error",
192
+ "no-console": ["error", { allow: ["warn", "error"] }],
193
+ "no-cond-assign": ["error", "always"],
194
+ "func-call-spacing": ["off", "never"],
195
+ "key-spacing": ["error", { beforeColon: false, afterColon: true }],
196
+ "indent": ["error", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
197
+ "no-restricted-syntax": [
198
+ "error",
199
+ "DebuggerStatement",
200
+ "LabeledStatement",
201
+ "WithStatement"
202
+ ],
203
+ "object-curly-spacing": ["error", "always"],
204
+ "no-return-await": "off",
205
+ "space-before-function-paren": [
206
+ "error",
207
+ {
208
+ anonymous: "always",
209
+ named: "never",
210
+ asyncArrow: "always"
211
+ }
212
+ ],
213
+ "no-var": "error",
214
+ "prefer-const": [
215
+ "error",
216
+ {
217
+ destructuring: "any",
218
+ ignoreReadBeforeAssign: true
219
+ }
220
+ ],
221
+ "prefer-arrow-callback": [
222
+ "error",
223
+ {
224
+ allowNamedFunctions: false,
225
+ allowUnboundThis: true
226
+ }
227
+ ],
228
+ "object-shorthand": [
229
+ "error",
230
+ "always",
231
+ {
232
+ ignoreConstructors: false,
233
+ avoidQuotes: true
234
+ }
235
+ ],
236
+ "prefer-exponentiation-operator": "error",
237
+ "prefer-rest-params": "error",
238
+ "prefer-spread": "error",
239
+ "prefer-template": "error",
240
+ "template-curly-spacing": "error",
241
+ "arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
242
+ "generator-star-spacing": "off",
243
+ "spaced-comment": ["error", "always", {
244
+ line: {
245
+ markers: ["/"],
246
+ exceptions: ["/", "#"]
247
+ },
248
+ block: {
249
+ markers: ["!"],
250
+ exceptions: ["*"],
251
+ balanced: true
252
+ }
253
+ }],
254
+ "array-callback-return": "error",
255
+ "block-scoped-var": "error",
256
+ "consistent-return": "off",
257
+ "complexity": ["off", 11],
258
+ "eqeqeq": ["error", "smart"],
259
+ "no-alert": "warn",
260
+ "no-case-declarations": "error",
261
+ "no-multi-spaces": "error",
262
+ "no-multi-str": "error",
263
+ "no-with": "error",
264
+ "no-void": "error",
265
+ "no-useless-escape": "off",
266
+ "vars-on-top": "error",
267
+ "require-await": "off",
268
+ "no-return-assign": "off",
269
+ "operator-linebreak": ["error", "before"],
270
+ "max-statements-per-line": ["error", { max: 1 }],
271
+
272
+ // unicorns
273
+ // Pass error message when throwing errors
274
+ "unicorn/error-message": "error",
275
+ // Uppercase regex escapes
276
+ "unicorn/escape-case": "error",
277
+ // Array.isArray instead of instanceof
278
+ "unicorn/no-instanceof-array": "error",
279
+ // Prevent deprecated `new Buffer()`
280
+ "unicorn/no-new-buffer": "error",
281
+ // Keep regex literals safe!
282
+ "unicorn/no-unsafe-regex": "off",
283
+ // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
284
+ "unicorn/number-literal-case": "error",
285
+ // includes over indexOf when checking for existence
286
+ "unicorn/prefer-includes": "error",
287
+ // String methods startsWith/endsWith instead of more complicated stuff
288
+ "unicorn/prefer-string-starts-ends-with": "error",
289
+ // textContent instead of innerText
290
+ "unicorn/prefer-text-content": "error",
291
+ // Enforce throwing type error when throwing error while checking typeof
292
+ "unicorn/prefer-type-error": "error",
293
+ // Use new when throwing error
294
+ "unicorn/throw-new-error": "error",
295
+
296
+ "no-use-before-define": ["error", { functions: false, classes: false, variables: true }],
297
+ "eslint-comments/disable-enable-pair": "off",
298
+ "import/no-named-as-default-member": "off",
299
+ "import/no-named-as-default": "off",
300
+ "import/namespace": "off",
301
+ "n/no-callback-literal": "off",
302
+
303
+ "sort-imports": [
304
+ "error",
305
+ {
306
+ ignoreCase: false,
307
+ ignoreDeclarationSort: true,
308
+ ignoreMemberSort: false,
309
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
310
+ allowSeparatedGroups: false
311
+ }
312
+ ],
313
+ "yml/quotes": ["error", { prefer: "single", avoidEscape: false }],
314
+ "yml/no-empty-document": "off"
315
+ }
316
+ };
package/src/index.js CHANGED
@@ -1,167 +1,11 @@
1
+ const { isPackageExists } = require("local-pkg");
2
+
3
+ const TS = isPackageExists("typescript");
4
+
1
5
  module.exports = {
2
- env: {
3
- es6: true,
4
- browser: true,
5
- node: true
6
- },
7
- reportUnusedDisableDirectives: true,
8
6
  extends: [
9
- "eslint-config-standard",
10
- "plugin:import/recommended",
11
- "plugin:eslint-comments/recommended",
12
- "plugin:jsonc/recommended-with-jsonc",
13
- "plugin:markdown/recommended",
14
- "plugin:yml/standard",
15
- "./javascript",
16
- "./typescript"
17
- ],
18
- ignorePatterns: [
19
- "*.min.*",
20
- "CHANGELOG.md",
21
- "dist",
22
- "build",
23
- "LICENSE*",
24
- "coverage",
25
- "public",
26
- "package-lock.json",
27
- "pnpm-lock.yaml",
28
- "yarn.lock",
29
- "!.github",
30
- "!.vscode"
31
- ],
32
- plugins: ["unicorn"],
33
- settings: {
34
- "import/resolver": {
35
- node: { extensions: [".js", ".mjs"] }
36
- }
37
- },
38
- overrides: [
39
- {
40
- files: ["*.json", "*.json5"],
41
- parser: "jsonc-eslint-parser",
42
- rules: {
43
- "jsonc/array-bracket-spacing": ["error", "never"],
44
- "jsonc/comma-dangle": ["error", "never"],
45
- "jsonc/comma-style": ["error", "last"],
46
- "jsonc/indent": ["error", 2],
47
- "jsonc/key-spacing": ["error", { beforeColon: false, afterColon: true }],
48
- "jsonc/no-octal-escape": "error",
49
- "jsonc/object-curly-newline": ["error", { multiline: true, consistent: true }],
50
- "jsonc/object-curly-spacing": ["error", "always"],
51
- "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }]
52
- }
53
- },
54
- {
55
- files: ["*.yaml", "*.yml"],
56
- parser: "yaml-eslint-parser",
57
- rules: {
58
- "spaced-comment": "off"
59
- }
60
- },
61
- {
62
- files: ["package.json"],
63
- parser: "jsonc-eslint-parser",
64
- rules: {
65
- "jsonc/sort-keys": [
66
- "error",
67
- {
68
- pathPattern: "^$",
69
- order: [
70
- "name",
71
- "publisher",
72
- "displayName",
73
- "version",
74
- "private",
75
- "type",
76
- "packageManager",
77
- "description",
78
- "author",
79
- "license",
80
- "funding",
81
- "homepage",
82
- "repository",
83
- "bugs",
84
- "keywords",
85
- "categories",
86
- "sideEffects",
87
- "exports",
88
- "main",
89
- "module",
90
- "types",
91
- "typesVersions",
92
- "bin",
93
- "icon",
94
- "files",
95
- "engines",
96
- "activationEvents",
97
- "contributes",
98
- "scripts",
99
- "peerDependencies",
100
- "peerDependenciesMeta",
101
- "dependencies",
102
- "optionalDependencies",
103
- "devDependencies",
104
- "pnpm"
105
- ]
106
- },
107
- {
108
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
109
- order: { type: "asc" }
110
- },
111
- {
112
- pathPattern: "^exports.*$",
113
- order: ["types", "require", "import"]
114
- }
115
- ]
116
- }
117
- },
118
- {
119
- files: ["*.d.ts"],
120
- rules: {
121
- "import/no-duplicates": "off"
122
- }
123
- },
124
- {
125
- files: ["*.js"],
126
- rules: {
127
- "@typescript-eslint/no-var-requires": "off"
128
- }
129
- },
130
- {
131
- files: ["scripts/**/*.*", "cli.*"],
132
- rules: {
133
- "no-console": "off"
134
- }
135
- },
136
- {
137
- files: ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
138
- rules: {
139
- "no-unused-expressions": "off"
140
- }
141
- },
142
- {
143
- files: ["**/*.md/*.*"],
144
- rules: {
145
- "@typescript-eslint/no-redeclare": "off",
146
- "@typescript-eslint/no-unused-vars": "off",
147
- "@typescript-eslint/no-use-before-define": "off",
148
- "@typescript-eslint/no-var-requires": "off",
149
- "@typescript-eslint/comma-dangle": "off",
150
- "import/no-unresolved": "off",
151
- "no-alert": "off",
152
- "no-console": "off",
153
- "no-restricted-imports": "off",
154
- "no-undef": "off",
155
- "no-unused-expressions": "off",
156
- "no-unused-vars": "off"
157
- }
158
- }
159
- ],
160
- rules: {
161
- "eol-last": "off",
162
- "no-trailing-spaces": "off",
163
- "padded-blocks": "off",
164
- "yml/quotes": ["error", { prefer: "single", avoidEscape: false }],
165
- "yml/no-empty-document": "off"
166
- }
7
+ TS
8
+ ? "./typescript"
9
+ : "./basic"
10
+ ]
167
11
  };
package/src/react.js ADDED
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ extends: [
3
+ "plugin:react/recommended",
4
+ "plugin:react-hooks/recommended",
5
+ "./typescript"
6
+ ],
7
+ settings: {
8
+ react: {
9
+ version: "17.0"
10
+ }
11
+ },
12
+ rules: {
13
+ "jsx-quotes": [
14
+ "error",
15
+ "prefer-double"
16
+ ],
17
+ "react/react-in-jsx-scope": "off"
18
+ }
19
+ };
package/src/typescript.js CHANGED
@@ -1,86 +1,81 @@
1
+ const basic = require("./basic");
2
+
1
3
  module.exports = {
2
4
  extends: [
5
+ "./basic",
3
6
  "plugin:import/typescript",
4
- "plugin:@typescript-eslint/recommended",
5
- "plugin:react/recommended"
7
+ "plugin:@typescript-eslint/recommended"
6
8
  ],
7
9
  settings: {
8
10
  "import/resolver": {
9
11
  node: { extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"] }
10
- },
11
- react: {
12
- version: "17.0"
13
12
  }
14
13
  },
14
+ overrides: basic.overrides,
15
15
  rules: {
16
16
  "import/named": "off",
17
17
  "@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
18
- "@typescript-eslint/member-delimiter-style": "warn",
18
+ "@typescript-eslint/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
19
19
  "@typescript-eslint/type-annotation-spacing": ["error", {}],
20
- "@typescript-eslint/consistent-type-imports": ["warn", {
21
- prefer: "type-imports",
22
- disallowTypeAnnotations: false
23
- }],
20
+ "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports", disallowTypeAnnotations: false }],
21
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
22
+ "@typescript-eslint/prefer-ts-expect-error": "error",
24
23
  "no-useless-constructor": "off",
25
- indent: "off",
26
- "@typescript-eslint/indent": [
27
- "error",
28
- 2,
29
- {
30
- SwitchCase: 1,
31
- VariableDeclarator: 1,
32
- outerIIFEBody: 1,
33
- MemberExpression: 1,
34
- FunctionDeclaration: { parameters: 1, body: 1 },
35
- FunctionExpression: { parameters: 1, body: 1 },
36
- CallExpression: { arguments: 1 },
37
- ArrayExpression: 1,
38
- ObjectExpression: 1,
39
- ImportDeclaration: 1,
40
- flatTernaryExpressions: false,
41
- ignoreComments: false,
42
- ignoredNodes: [
43
- "TemplateLiteral *",
44
- "JSXElement",
45
- "JSXElement > *",
46
- "JSXAttribute",
47
- "JSXIdentifier",
48
- "JSXNamespacedName",
49
- "JSXMemberExpression",
50
- "JSXSpreadAttribute",
51
- "JSXExpressionContainer",
52
- "JSXOpeningElement",
53
- "JSXClosingElement",
54
- "JSXFragment",
55
- "JSXOpeningFragment",
56
- "JSXClosingFragment",
57
- "JSXText",
58
- "JSXEmptyExpression",
59
- "JSXSpreadChild",
60
- "TSTypeParameterInstantiation"
61
- ],
62
- offsetTernaryExpressions: true
63
- }
64
- ],
24
+ "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
+ }],
65
63
  "no-unused-vars": "off",
66
- "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
64
+ "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
67
65
  "no-redeclare": "off",
68
66
  "@typescript-eslint/no-redeclare": "error",
69
67
  "no-use-before-define": "off",
70
- "@typescript-eslint/no-use-before-define": [
71
- "error",
72
- { functions: false, classes: false, variables: true }
73
- ],
68
+ "@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false, variables: true }],
74
69
  "brace-style": "off",
75
- "@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }],
70
+ "@typescript-eslint/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
76
71
  "comma-dangle": "off",
77
- "@typescript-eslint/comma-dangle": ["error", "only-multiline"],
72
+ "@typescript-eslint/comma-dangle": ["error", "never"],
78
73
  "object-curly-spacing": "off",
79
74
  "@typescript-eslint/object-curly-spacing": ["error", "always"],
80
- semi: "off",
75
+ "semi": "off",
81
76
  "@typescript-eslint/semi": ["warn", "always"],
82
- quotes: "off",
83
- "@typescript-eslint/quotes": ["warn", "double"],
77
+ "quotes": "off",
78
+ "@typescript-eslint/quotes": ["error", "double"],
84
79
  "space-before-blocks": "off",
85
80
  "@typescript-eslint/space-before-blocks": ["error", "always"],
86
81
  "space-before-function-paren": "off",
@@ -105,11 +100,7 @@ module.exports = {
105
100
  "no-loss-of-precision": "off",
106
101
  "@typescript-eslint/no-loss-of-precision": "error",
107
102
  "lines-between-class-members": "off",
108
- "@typescript-eslint/lines-between-class-members": [
109
- "error",
110
- "always",
111
- { exceptAfterSingleLine: true }
112
- ],
103
+ "@typescript-eslint/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
113
104
  "@typescript-eslint/consistent-indexed-object-style": "off",
114
105
  "@typescript-eslint/naming-convention": "off",
115
106
  "@typescript-eslint/explicit-function-return-type": "off",
@@ -123,10 +114,6 @@ module.exports = {
123
114
  "@typescript-eslint/explicit-module-boundary-types": "off",
124
115
  "@typescript-eslint/ban-types": "off",
125
116
  "@typescript-eslint/no-namespace": "off",
126
- "@typescript-eslint/triple-slash-reference": "off",
127
-
128
- // REACT
129
- "jsx-quotes": ["warn", "prefer-double"],
130
- "react/react-in-jsx-scope": "off"
117
+ "@typescript-eslint/triple-slash-reference": "off"
131
118
  }
132
119
  };
package/src/javascript.js DELETED
@@ -1,128 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- "import/order": "error",
4
- "import/first": "error",
5
- "import/no-mutable-exports": "error",
6
- "import/no-unresolved": "off",
7
- "import/no-absolute-path": "off",
8
- semi: ["warn", "always"],
9
- quotes: ["error", "double"],
10
- "quote-props": ["warn", "as-needed"],
11
- "no-unused-vars": "warn",
12
- "no-param-reassign": "off",
13
- "array-bracket-spacing": ["error", "never"],
14
- "brace-style": ["error", "1tbs", { allowSingleLine: true }],
15
- "block-spacing": ["error", "always"],
16
- camelcase: "off",
17
- "comma-spacing": ["error", { before: false, after: true }],
18
- "comma-style": ["error", "last"],
19
- "comma-dangle": ["error", "only-multiline"],
20
- "no-constant-condition": "warn",
21
- "no-debugger": "error",
22
- "no-console": ["warn", { allow: ["warn", "error"] }],
23
- "no-cond-assign": ["error", "always"],
24
- "func-call-spacing": ["off", "never"],
25
- "key-spacing": ["error", { beforeColon: false, afterColon: true }],
26
- indent: ["error", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }],
27
- "no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
28
- "object-curly-spacing": ["error", "always"],
29
- "no-return-await": "off",
30
- "space-before-function-paren": [
31
- "error",
32
- {
33
- anonymous: "always",
34
- named: "never",
35
- asyncArrow: "always"
36
- }
37
- ],
38
- // "no-multiple-empty-lines": ["warn", { max: 1, maxBOF: 0, maxEOF: 0 }],
39
- "no-multiple-empty-lines": "off",
40
- "no-var": "error",
41
- "prefer-const": [
42
- "error",
43
- {
44
- destructuring: "any",
45
- ignoreReadBeforeAssign: true
46
- }
47
- ],
48
- "prefer-arrow-callback": [
49
- "error",
50
- {
51
- allowNamedFunctions: false,
52
- allowUnboundThis: true
53
- }
54
- ],
55
- "object-shorthand": [
56
- "error",
57
- "always",
58
- {
59
- ignoreConstructors: false,
60
- avoidQuotes: true
61
- }
62
- ],
63
- "prefer-exponentiation-operator": "error",
64
- "prefer-rest-params": "error",
65
- "prefer-spread": "error",
66
- "prefer-template": "error",
67
- "template-curly-spacing": "error",
68
- "generator-star-spacing": "off",
69
- "spaced-comment": [
70
- "error",
71
- "always",
72
- {
73
- line: {
74
- markers: ["/"],
75
- exceptions: ["/", "#"]
76
- },
77
- block: {
78
- markers: ["!"],
79
- exceptions: ["*"],
80
- balanced: true
81
- }
82
- }
83
- ],
84
- "array-callback-return": "error",
85
- "block-scoped-var": "error",
86
- "consistent-return": "off",
87
- complexity: ["off", 11],
88
- eqeqeq: ["error", "smart"],
89
- "no-alert": "warn",
90
- "no-case-declarations": "error",
91
- "no-multi-spaces": "error",
92
- "no-multi-str": "error",
93
- "no-with": "error",
94
- "no-void": "error",
95
- "no-useless-escape": "off",
96
- "vars-on-top": "error",
97
- "require-await": "off",
98
- "no-return-assign": "off",
99
- "operator-linebreak": ["error", "before"],
100
- "unicorn/error-message": "error",
101
- "unicorn/escape-case": "error",
102
- "unicorn/no-instanceof-array": "error",
103
- "unicorn/no-new-buffer": "error",
104
- "unicorn/no-unsafe-regex": "off",
105
- "unicorn/number-literal-case": "error",
106
- "unicorn/prefer-includes": "error",
107
- "unicorn/prefer-starts-ends-with": "error",
108
- "unicorn/prefer-text-content": "error",
109
- "unicorn/prefer-type-error": "error",
110
- "unicorn/throw-new-error": "error",
111
- "no-use-before-define": ["error", { functions: false, classes: false, variables: true }],
112
- "eslint-comments/disable-enable-pair": "off",
113
- "import/no-named-as-default-member": "off",
114
- "import/no-named-as-default": "off",
115
- "import/namespace": "off",
116
- "n/no-callback-literal": "off",
117
- "sort-imports": [
118
- "error",
119
- {
120
- ignoreCase: false,
121
- ignoreDeclarationSort: true,
122
- ignoreMemberSort: false,
123
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
124
- allowSeparatedGroups: false
125
- }
126
- ]
127
- }
128
- };