@jsenv/eslint-config-relax 1.6.7 → 1.7.0
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 +8 -7
- package/src/eslint_config_relax.js +10 -0
- 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.0",
|
|
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
|
-
"@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
|
-
"eslint-plugin-html": "8.1.
|
|
31
|
-
"eslint-plugin-import-x": "4.
|
|
31
|
+
"eslint-plugin-html": "8.1.3",
|
|
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";
|
|
@@ -122,6 +123,15 @@ export const eslintConfigRelax = ({
|
|
|
122
123
|
"import-x/ignore": ["node_modules/playwright/"],
|
|
123
124
|
},
|
|
124
125
|
},
|
|
126
|
+
// jsenv plugin
|
|
127
|
+
{
|
|
128
|
+
plugins: {
|
|
129
|
+
jsenv: jsenvPlugin,
|
|
130
|
+
},
|
|
131
|
+
rules: {
|
|
132
|
+
"jsenv/no-unknown-params": ["off"], // Default: only report likely typos
|
|
133
|
+
},
|
|
134
|
+
},
|
|
125
135
|
// node "module" files
|
|
126
136
|
{
|
|
127
137
|
files: ["**/*.js", "**/*.mjs", "**/*.jsx"],
|
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
|
/*
|