@jsenv/eslint-config-relax 1.6.12 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/eslint-config-relax",
3
- "version": "1.6.12",
3
+ "version": "1.7.1",
4
4
  "description": "A pleaseant ESLint configuration for any project",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,14 +24,15 @@
24
24
  ],
25
25
  "scripts": {},
26
26
  "dependencies": {
27
- "@babel/eslint-parser": "7.28.0",
28
- "@jsenv/eslint-import-resolver": "8.4.1",
27
+ "@babel/eslint-parser": "7.28.4",
28
+ "@jsenv/eslint-import-resolver": "8.4.2",
29
+ "@jsenv/eslint-plugin": "1.0.0",
29
30
  "@jsenv/urls": "2.9.1",
30
31
  "eslint-plugin-html": "8.1.3",
31
32
  "eslint-plugin-import-x": "4.16.1",
32
33
  "eslint-plugin-react": "7.37.5",
33
- "eslint-plugin-regexp": "2.9.0",
34
- "globals": "16.3.0"
34
+ "eslint-plugin-regexp": "2.10.0",
35
+ "globals": "16.4.0"
35
36
  },
36
37
  "devDependencies": {},
37
38
  "engines": {
@@ -1,4 +1,5 @@
1
1
  import babelParser from "@babel/eslint-parser";
2
+ import jsenvPlugin from "@jsenv/eslint-plugin";
2
3
  import { urlToRelativeUrl } from "@jsenv/urls";
3
4
  import html from "eslint-plugin-html";
4
5
  import pluginImportX from "eslint-plugin-import-x";
@@ -35,6 +36,8 @@ export const eslintConfigRelax = ({
35
36
  prettierSortImport,
36
37
  jsxPragmaAuto = false,
37
38
  preact,
39
+ reactVersion = "detect",
40
+ reactVersionForPreact = "19.2.0",
38
41
  importResolutionLogLevel,
39
42
 
40
43
  browserFiles = [],
@@ -122,6 +125,15 @@ export const eslintConfigRelax = ({
122
125
  "import-x/ignore": ["node_modules/playwright/"],
123
126
  },
124
127
  },
128
+ // jsenv plugin
129
+ {
130
+ plugins: {
131
+ jsenv: jsenvPlugin,
132
+ },
133
+ rules: {
134
+ "jsenv/no-unknown-params": ["off"], // Default: only report likely typos
135
+ },
136
+ },
125
137
  // node "module" files
126
138
  {
127
139
  files: ["**/*.js", "**/*.mjs", "**/*.jsx"],
@@ -180,7 +192,7 @@ export const eslintConfigRelax = ({
180
192
  },
181
193
  settings: {
182
194
  react: {
183
- version: "detect",
195
+ version: preact ? reactVersionForPreact : reactVersion,
184
196
  },
185
197
  },
186
198
  rules: {
@@ -4,6 +4,7 @@ export const explicitGlobals = {
4
4
  blur: "off",
5
5
  btoa: "off",
6
6
  caches: "off",
7
+ constructor: "off",
7
8
  close: "off",
8
9
  closed: "off",
9
10
  crypto: "off",
@@ -51,7 +51,7 @@ export const rulesRelax = {
51
51
  "consistent-return": ["error"],
52
52
  "constructor-super": ["error"],
53
53
  "curly": ["error"],
54
- "default-case": ["error"],
54
+ "default-case": ["off"], // not alawys needed so it's annoying
55
55
  "dot-location": ["error", "property"],
56
56
  "dot-notation": ["off"],
57
57
  "eol-last": ["off"],
@@ -225,7 +225,19 @@ export const rulesRelax = {
225
225
  "no-unused-expressions": ["error"],
226
226
  "no-unused-labels": ["off"], // https://gist.github.com/getify/706e5e10822a298375da40f9cc1fa295
227
227
  "no-unused-private-class-members": ["error"],
228
- "no-unused-vars": ["error"],
228
+ "no-unused-vars": [
229
+ "error",
230
+ {
231
+ // it's better to ensure rest siblings are reported
232
+ // because otherwise it's easy to miss that they get stripped of param forwaring
233
+ // which happens a lot in rect components
234
+ // const { importantParam, ...rest} =props;
235
+ // <OtherComponent {...rest} />
236
+ // If "importantParam" is not used, rest will not contains it anymore
237
+ // which can lead to bugs if OtherComponent expect "importantParam" to be there
238
+ ignoreRestSiblings: false,
239
+ },
240
+ ],
229
241
  "no-use-before-define": [
230
242
  "error",
231
243
  /*