@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 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 [...backend, {
34
- ignores: [
35
- "/**/reports",
36
- "/dist",
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 [...frontend, {
50
- ignores: [
51
- "/**/reports",
52
- "/dist",
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 [...frontend,
74
- {
75
- ignores: [
76
- "/**/reports",
77
- "/dist",
78
- ],
79
- languageOptions: {
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
@@ -11,6 +11,7 @@ export default {
11
11
  languageOptions: {
12
12
  ecmaVersion: "latest",
13
13
  sourceType: "module",
14
+ globals: { global: true },
14
15
  },
15
16
 
16
17
  plugins: {
package/front-react.js CHANGED
@@ -10,6 +10,7 @@ export default [
10
10
  react,
11
11
  vitest,
12
12
  {
13
+ settings: { react: { version: "detect" } },
13
14
  languageOptions: {
14
15
  globals: {
15
16
  ...globals.browser,
package/next.js CHANGED
@@ -12,6 +12,7 @@ export default [
12
12
  next,
13
13
  vitest,
14
14
  {
15
+ settings: { react: { version: "detect" } },
15
16
  languageOptions: {
16
17
  globals: {
17
18
  ...globals.browser,
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@prowise/eslint-config-linting-rules","version":"2.1.0","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":{"@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"}}
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"}}
@@ -7,6 +7,7 @@ export default {
7
7
 
8
8
  languageOptions: {
9
9
  globals: {
10
+ process: true,
10
11
  ...globals.jest,
11
12
  },
12
13
  },
@@ -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": "warn",
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 ✅
@@ -6,6 +6,7 @@ export default {
6
6
 
7
7
  languageOptions: {
8
8
  globals: {
9
+ process: true,
9
10
  suite: true,
10
11
  test: true,
11
12
  describe: true,