@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 +6 -5
- package/src/eslint_config_relax.js +13 -1
- package/src/explicit_globals.js +1 -0
- package/src/rules_relax.js +14 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/eslint-config-relax",
|
|
3
|
-
"version": "1.
|
|
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.
|
|
28
|
-
"@jsenv/eslint-import-resolver": "8.4.
|
|
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.
|
|
34
|
-
"globals": "16.
|
|
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:
|
|
195
|
+
version: preact ? reactVersionForPreact : reactVersion,
|
|
184
196
|
},
|
|
185
197
|
},
|
|
186
198
|
rules: {
|
package/src/explicit_globals.js
CHANGED
package/src/rules_relax.js
CHANGED
|
@@ -51,7 +51,7 @@ export const rulesRelax = {
|
|
|
51
51
|
"consistent-return": ["error"],
|
|
52
52
|
"constructor-super": ["error"],
|
|
53
53
|
"curly": ["error"],
|
|
54
|
-
"default-case": ["
|
|
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": [
|
|
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
|
/*
|