@prowise/eslint-config-linting-rules 2.1.0 → 2.1.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/README.md +26 -19
- package/base.js +1 -0
- package/front-react.js +1 -0
- package/next.js +1 -0
- package/package.json +1 -1
- package/rules/plugin-jest-rules.js +1 -0
- package/rules/plugin-typescript-rules.js +8 -1
- package/rules/plugin-vitest-rules.js +1 -0
package/README.md
CHANGED
|
@@ -30,12 +30,12 @@ Sample of a `eslint.config.js` file for a backend project using node and typescr
|
|
|
30
30
|
```
|
|
31
31
|
import backend from "@prowise/eslint-config-linting-rules/backend";
|
|
32
32
|
|
|
33
|
-
export default [
|
|
34
|
-
ignores: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
languageOptions: {
|
|
33
|
+
export default [
|
|
34
|
+
{ ignores: [ "**/reports", "**/dist/"] },
|
|
35
|
+
|
|
36
|
+
...backend,
|
|
37
|
+
|
|
38
|
+
{ languageOptions: {
|
|
39
39
|
parserOptions: { project: "./tsconfig.json" },
|
|
40
40
|
},
|
|
41
41
|
}];
|
|
@@ -46,12 +46,11 @@ Sample of a `eslint.config.js` file for a frontend project using react and types
|
|
|
46
46
|
```
|
|
47
47
|
import backend from "@prowise/eslint-config-linting-rules/frontend";
|
|
48
48
|
|
|
49
|
-
export default [
|
|
50
|
-
ignores: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
languageOptions: {
|
|
49
|
+
export default [
|
|
50
|
+
{ ignores: [ "**/reports", "**/dist/"] },
|
|
51
|
+
|
|
52
|
+
...frontend,
|
|
53
|
+
{ languageOptions: {
|
|
55
54
|
parserOptions: { project: "./tsconfig.json" },
|
|
56
55
|
},
|
|
57
56
|
}];
|
|
@@ -60,6 +59,14 @@ export default [...frontend, {
|
|
|
60
59
|
|
|
61
60
|
Additional information can be found at: https://eslint.org/docs/latest/use/getting-started
|
|
62
61
|
|
|
62
|
+
## Inspect your configuration
|
|
63
|
+
|
|
64
|
+
ESLint version 9 comes with a nice inspector to verify your settings. It can be opened by installing it as a global node app together with eslint:
|
|
65
|
+
```
|
|
66
|
+
npm i -g eslint @eslint/config-inspector
|
|
67
|
+
```
|
|
68
|
+
After this you can run it by `eslint --inspect-config`
|
|
69
|
+
Or just run it from the command line without installing it first by `npx @eslint/config-inspector`
|
|
63
70
|
|
|
64
71
|
## Migrating from version 1 (eslint <= 8.*.*)
|
|
65
72
|
|
|
@@ -70,13 +77,13 @@ If you want different configuration for the different folders yo can use the fol
|
|
|
70
77
|
```
|
|
71
78
|
import frontend from "@prowise/eslint-config-linting-rules/frontend";
|
|
72
79
|
|
|
73
|
-
export default [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
export default [
|
|
81
|
+
// IGNORES MUST BE ON TOP !
|
|
82
|
+
{ ignores: [ "**/reports", "**/dist/"] },
|
|
83
|
+
|
|
84
|
+
...frontend,
|
|
85
|
+
|
|
86
|
+
{ languageOptions: {
|
|
80
87
|
parserOptions: { project: "./tsconfig.json" },
|
|
81
88
|
},
|
|
82
89
|
},
|
package/base.js
CHANGED
package/front-react.js
CHANGED
package/next.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@prowise/eslint-config-linting-rules","version":"2.1.
|
|
1
|
+
{"name":"@prowise/eslint-config-linting-rules","version":"2.1.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","./next":"./next.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":{"@next/eslint-plugin-next":"^15.1.0","@stylistic/eslint-plugin":"^2.12.1","confusing-browser-globals":"^1.0.11","eslint":"^9.17.0","eslint-import-resolver-typescript":"^3.7.0","eslint-plugin-import-x":"^4.5.0","eslint-plugin-jest":"^28.9.0","eslint-plugin-jsdoc":"^50.6.1","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.15.0","eslint-plugin-prefer-arrow-functions":"^3.4.1","eslint-plugin-react":"^7.37.2","eslint-plugin-react-hooks":"^5.1.0","eslint-plugin-solid":"^0.14.5","eslint-plugin-vitest":"^0.5.4","globals":"^15.13.0","typescript-eslint":"^8.18.1"},"devDependencies":{"@eslint/config-inspector":"^0.6.0"}}
|
|
@@ -684,7 +684,14 @@ export default {
|
|
|
684
684
|
* Require switch-case statements to be exhaustive with union type 💡 💭
|
|
685
685
|
* https://typescript-eslint.io/rules/switch-exhaustiveness-check.
|
|
686
686
|
*/
|
|
687
|
-
"@typescript-eslint/switch-exhaustiveness-check":
|
|
687
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
688
|
+
"error",
|
|
689
|
+
{
|
|
690
|
+
allowDefaultCaseForExhaustiveSwitch: true,
|
|
691
|
+
considerDefaultExhaustiveForUnions: true,
|
|
692
|
+
requireDefaultForNonUnion: true,
|
|
693
|
+
},
|
|
694
|
+
],
|
|
688
695
|
|
|
689
696
|
/**
|
|
690
697
|
* Disallow certain triple slash directives in favor of ES6-style import declarations ✅
|