@prowise/eslint-config-linting-rules 2.0.1 → 2.0.2
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/backend.js +3 -2
- package/eslint.config.js +6 -1
- package/index.js +3 -0
- package/package.json +1 -1
- package/rules/plugin-import-rules.js +2 -2
- package/rules/plugin-jest-rules.js +6 -0
- package/rules/plugin-typescript-rules.js +9 -36
- package/rules/test-rules.js +0 -7
package/backend.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import base from "./base.js";
|
|
1
2
|
import node from "./rules/plugin-node-rules.js";
|
|
3
|
+
import typescript from "./rules/plugin-typescript-rules.js";
|
|
2
4
|
import vitest from "./rules/plugin-vitest-rules.js";
|
|
3
|
-
import typescript from "./typescript.js";
|
|
4
5
|
|
|
5
|
-
export default [node, typescript, vitest];
|
|
6
|
+
export default [base, node, typescript, vitest];
|
package/eslint.config.js
CHANGED
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@prowise/eslint-config-linting-rules","version":"2.0.
|
|
1
|
+
{"name":"@prowise/eslint-config-linting-rules","version":"2.0.2","description":"Default Prowise linting rules for npm packages.","main":"index.js","type":"module","exports":{"./typescript":"./typescript.js","./backend":"./backend.js","./front-react":"./front-react.js","./front-solid":"./front-solid.js"},"scripts":{"lint":"eslint","inspect":"eslint --inspect-config"},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/prowise/npm-linting-rules.git"},"author":"Prowise B.V.","license":"UNLICENSED","homepage":"https://bitbucket.org/prowise/npm-linting-rules#readme","dependencies":{"@stylistic/eslint-plugin":"^2.8.0","confusing-browser-globals":"^1.0.11","eslint":"^9.11.1","eslint-import-resolver-typescript":"^3.6.3","eslint-plugin-import-x":"^4.3.0","eslint-plugin-jest":"^28.8.3","eslint-plugin-jsdoc":"^50.2.4","eslint-plugin-jsx-a11y":"^6.10.0","eslint-plugin-n":"^17.10.3","eslint-plugin-prefer-arrow":"^1.2.3","eslint-plugin-react":"^7.36.1","eslint-plugin-solid":"^0.14.3","eslint-plugin-vitest":"^0.5.4","globals":"^15.9.0","typescript-eslint":"^8.7.0"},"devDependencies":{"@eslint/config-inspector":"^0.5.4"}}
|
|
@@ -204,13 +204,13 @@ export default {
|
|
|
204
204
|
* Do not allow a default import name to match a named export
|
|
205
205
|
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md.
|
|
206
206
|
*/
|
|
207
|
-
|
|
207
|
+
"import/no-named-as-default": "error",
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Warn on accessing default export property names that are also named exports
|
|
211
211
|
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md.
|
|
212
212
|
*/
|
|
213
|
-
|
|
213
|
+
"import/no-named-as-default-member": "error",
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
216
|
* Prevent importing the default as if it were named
|
|
@@ -26,6 +26,12 @@ export default {
|
|
|
26
26
|
*/
|
|
27
27
|
"jest/no-deprecated-functions": "error",
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Disallow using a callback in asynchronous tests and hooks ✅
|
|
31
|
+
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-done-callback.md
|
|
32
|
+
*/
|
|
33
|
+
"jest/no-done-callback": "warn",
|
|
34
|
+
|
|
29
35
|
/**
|
|
30
36
|
* Disallow using exports in files containing tests ✅
|
|
31
37
|
* https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-export.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-unresolved
|
|
2
|
-
import typescriptPlugin from "
|
|
3
|
-
import
|
|
2
|
+
import typescriptPlugin from "typescript-eslint";
|
|
3
|
+
import baseRules from "./baseSettings.js";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
/*
|
|
@@ -11,12 +11,11 @@ export default {
|
|
|
11
11
|
* 💭 requires type information
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
plugins: { "@typescript-eslint": typescriptPlugin },
|
|
14
|
+
plugins: { "@typescript-eslint": typescriptPlugin.plugin },
|
|
15
15
|
languageOptions: {
|
|
16
|
+
parser: typescriptPlugin.parser,
|
|
16
17
|
parserOptions: {
|
|
17
18
|
project: true,
|
|
18
|
-
projectService: true,
|
|
19
|
-
tsconfigRootDir: import.meta.dirname,
|
|
20
19
|
},
|
|
21
20
|
},
|
|
22
21
|
|
|
@@ -252,10 +251,10 @@ export default {
|
|
|
252
251
|
"@typescript-eslint/no-empty-function": baseRules.rules["no-empty-function"],
|
|
253
252
|
|
|
254
253
|
/**
|
|
255
|
-
* Disallow
|
|
256
|
-
* https://typescript-eslint.io/rules/no-empty-
|
|
254
|
+
* Disallow accidentally using the "empty object" type ✅ 🔧 💡
|
|
255
|
+
* https://typescript-eslint.io/rules/no-empty-object-type.
|
|
257
256
|
*/
|
|
258
|
-
"@typescript-eslint/no-empty-
|
|
257
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
259
258
|
|
|
260
259
|
/**
|
|
261
260
|
* Disallow the any type ✅ 🔧 💡
|
|
@@ -322,13 +321,6 @@ export default {
|
|
|
322
321
|
"no-loop-func": "off",
|
|
323
322
|
"@typescript-eslint/no-loop-func": baseRules.rules["no-loop-func"],
|
|
324
323
|
|
|
325
|
-
/**
|
|
326
|
-
* Disallow literal numbers that lose precision. ✅
|
|
327
|
-
* https://typescript-eslint.io/rules/no-loss-of-precision.
|
|
328
|
-
*/
|
|
329
|
-
"no-loss-of-precision": "off",
|
|
330
|
-
"@typescript-eslint/no-loss-of-precision": baseRules.rules["no-loss-of-precision"],
|
|
331
|
-
|
|
332
324
|
/**
|
|
333
325
|
* Disallow magic numbers.
|
|
334
326
|
* Https://typescript-eslint.io/rules/no-magic-numbers.
|
|
@@ -392,16 +384,15 @@ export default {
|
|
|
392
384
|
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
393
385
|
|
|
394
386
|
/**
|
|
395
|
-
* Disallow invocation of require()
|
|
387
|
+
* Disallow invocation of require() ✅
|
|
396
388
|
* https://typescript-eslint.io/rules/no-require-imports.
|
|
397
389
|
*/
|
|
398
|
-
"@typescript-eslint/no-require-imports": "
|
|
390
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
399
391
|
|
|
400
392
|
/**
|
|
401
393
|
* Disallow unnecessary return await
|
|
402
394
|
* https://typescript-eslint.io/rules/return-await.
|
|
403
395
|
*/
|
|
404
|
-
"no-return-await": "off",
|
|
405
396
|
"@typescript-eslint/return-await": "warn",
|
|
406
397
|
|
|
407
398
|
/**
|
|
@@ -424,12 +415,6 @@ export default {
|
|
|
424
415
|
*/
|
|
425
416
|
"@typescript-eslint/no-this-alias": "error",
|
|
426
417
|
|
|
427
|
-
/**
|
|
428
|
-
* Disallow type aliases
|
|
429
|
-
* https://typescript-eslint.io/rules/no-type-alias.
|
|
430
|
-
*/
|
|
431
|
-
"@typescript-eslint/no-type-alias": "off",
|
|
432
|
-
|
|
433
418
|
/**
|
|
434
419
|
* Disallow unnecessary equality comparisons against boolean literals 🔒 🔧 💭
|
|
435
420
|
* https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare.
|
|
@@ -533,12 +518,6 @@ export default {
|
|
|
533
518
|
*/
|
|
534
519
|
"@typescript-eslint/no-useless-empty-export": "warn",
|
|
535
520
|
|
|
536
|
-
/**
|
|
537
|
-
* Disallow require statements except in import statements ✅
|
|
538
|
-
* https://typescript-eslint.io/rules/no-var-requires.
|
|
539
|
-
*/
|
|
540
|
-
"@typescript-eslint/no-var-requires": "error",
|
|
541
|
-
|
|
542
521
|
/**
|
|
543
522
|
* Enforce non-null assertions over explicit type casts 🔒 🔧 💭
|
|
544
523
|
* https://typescript-eslint.io/rules/non-nullable-type-assertion-style.
|
|
@@ -648,12 +627,6 @@ export default {
|
|
|
648
627
|
*/
|
|
649
628
|
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
650
629
|
|
|
651
|
-
/**
|
|
652
|
-
* Enforce using @ts-expect-error over @ts-ignore 🔒 🔧
|
|
653
|
-
* https://typescript-eslint.io/rules/prefer-ts-expect-error.
|
|
654
|
-
*/
|
|
655
|
-
"@typescript-eslint/prefer-ts-expect-error": "warn",
|
|
656
|
-
|
|
657
630
|
/**
|
|
658
631
|
* Require any function or method that returns a Promise to be marked async 🔧 💭
|
|
659
632
|
* https://typescript-eslint.io/rules/promise-function-async.
|
package/rules/test-rules.js
CHANGED
|
@@ -72,13 +72,6 @@ const rules = {
|
|
|
72
72
|
*/
|
|
73
73
|
"no-disabled-tests": "warn",
|
|
74
74
|
|
|
75
|
-
/**
|
|
76
|
-
* Disallow using a callback in asynchronous tests and hooks ✅
|
|
77
|
-
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-done-callback.md
|
|
78
|
-
* Vitest: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-done-callback.md
|
|
79
|
-
*/
|
|
80
|
-
"no-done-callback": "warn",
|
|
81
|
-
|
|
82
75
|
/**
|
|
83
76
|
* Disallow duplicate setup and teardown hooks
|
|
84
77
|
* Jest: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-duplicate-hooks.md
|