@pob/eslint-config 56.0.0 → 57.0.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/CHANGELOG.md +24 -1
- package/lib/_base.js +39 -15
- package/lib/base/commonjs.js +8 -4
- package/lib/base/module.js +22 -4
- package/lib/index.js +67 -13
- package/lib/node/_base.js +10 -18
- package/lib/node/commonjs.js +13 -23
- package/lib/node/module.js +21 -30
- package/lib/plugins/import/import-base.js +105 -72
- package/lib/plugins/import/import-commonjs.js +1 -3
- package/lib/plugins/import/import-module.js +1 -3
- package/lib/plugins/unicorn.js +238 -239
- package/lib/rules/best-practices.js +11 -5
- package/lib/rules/code-quality.js +1 -3
- package/lib/rules/dev-only.js +3 -3
- package/lib/rules/errors.js +1 -3
- package/lib/rules/style.js +1 -3
- package/package.json +9 -8
- package/utils.js +1 -3
- package/lib/.eslintrc.json +0 -4
- package/lib/node-commonjs.js +0 -25
- package/lib/node-module.js +0 -25
- package/lib/root-commonjs.js +0 -6
- package/lib/root-module.js +0 -6
- package/lib/rules/modules/base.js +0 -8
- package/lib/rules/modules/commonjs.js +0 -11
- package/lib/rules/modules/esm.js +0 -25
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import confusingBrowserGlobals from "confusing-browser-globals";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
3
|
+
export default {
|
|
6
4
|
rules: {
|
|
7
5
|
// https://eslint.org/docs/rules/accessor-pairs
|
|
8
6
|
"accessor-pairs": "off",
|
|
@@ -198,6 +196,9 @@ module.exports = {
|
|
|
198
196
|
// https://eslint.org/docs/rules/no-new-object
|
|
199
197
|
"no-new-object": "error",
|
|
200
198
|
|
|
199
|
+
// disallow use of new operator with the require function
|
|
200
|
+
"no-new-require": "error",
|
|
201
|
+
|
|
201
202
|
// https://eslint.org/docs/rules/no-new-wrappers
|
|
202
203
|
"no-new-wrappers": "error",
|
|
203
204
|
|
|
@@ -343,7 +344,12 @@ module.exports = {
|
|
|
343
344
|
// https://eslint.org/docs/rules/no-unused-vars
|
|
344
345
|
"no-unused-vars": [
|
|
345
346
|
"error",
|
|
346
|
-
{
|
|
347
|
+
{
|
|
348
|
+
vars: "all",
|
|
349
|
+
args: "none",
|
|
350
|
+
caughtErrors: "none",
|
|
351
|
+
ignoreRestSiblings: true,
|
|
352
|
+
},
|
|
347
353
|
],
|
|
348
354
|
|
|
349
355
|
// https://eslint.org/docs/rules/no-use-before-define
|
package/lib/rules/dev-only.js
CHANGED
package/lib/rules/errors.js
CHANGED
package/lib/rules/style.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pob/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "57.0.0",
|
|
4
4
|
"description": "eslint config files",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Christophe Hurpeau <christophe@hurpeau.com> (http://christophe.hurpeau.com/)",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "@pob/eslint-config"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/christophehurpeau/eslint-config-pob",
|
|
14
|
-
"type": "
|
|
14
|
+
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=18.12.0"
|
|
17
17
|
},
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
"main": "./lib/index.js",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./lib/index.js",
|
|
22
|
-
"./node-commonjs": "./lib/node-commonjs.js",
|
|
23
|
-
"./node-module": "./lib/node-module.js",
|
|
24
|
-
"./root-commonjs": "./lib/root-commonjs.js",
|
|
25
|
-
"./root-module": "./lib/root-module.js",
|
|
26
22
|
"./lib/rules/best-practices": "./lib/rules/best-practices.js",
|
|
27
23
|
"./lib/rules/code-quality": "./lib/rules/code-quality.js",
|
|
28
24
|
"./lib/rules/errors": "./lib/rules/errors.js",
|
|
@@ -39,7 +35,7 @@
|
|
|
39
35
|
],
|
|
40
36
|
"scripts": {
|
|
41
37
|
"lint": "yarn run lint:eslint",
|
|
42
|
-
"lint:eslint": "yarn ../.. run eslint --
|
|
38
|
+
"lint:eslint": "yarn ../.. run eslint --quiet @pob/eslint-config"
|
|
43
39
|
},
|
|
44
40
|
"pob": {},
|
|
45
41
|
"prettier": "@pob/root/prettier-config",
|
|
@@ -47,6 +43,10 @@
|
|
|
47
43
|
"eslint": "^8.56.0"
|
|
48
44
|
},
|
|
49
45
|
"dependencies": {
|
|
46
|
+
"@eslint/compat": "^1.1.1",
|
|
47
|
+
"@eslint/eslintrc": "2.1.4",
|
|
48
|
+
"@eslint/js": "^8.56.0",
|
|
49
|
+
"@pob/eslint-plugin": "57.0.0",
|
|
50
50
|
"confusing-browser-globals": "^1.0.11",
|
|
51
51
|
"eslint-plugin-import": "^2.29.1",
|
|
52
52
|
"eslint-plugin-n": "^17.4.0",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"eslint": "8.57.0",
|
|
57
57
|
"eslint-plugin-import": "2.29.1",
|
|
58
58
|
"eslint-plugin-n": "17.4.0",
|
|
59
|
-
"eslint-plugin-unicorn": "52.0.0"
|
|
59
|
+
"eslint-plugin-unicorn": "52.0.0",
|
|
60
|
+
"typescript": "5.5.4"
|
|
60
61
|
}
|
|
61
62
|
}
|
package/utils.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
const isVSCode =
|
|
4
2
|
process.argv &&
|
|
5
3
|
process.argv.some((argv) => argv.includes("dbaeumer.vscode-eslint"));
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
export const enableIfVSCode = (ruleLevel) => (isVSCode ? ruleLevel : "off");
|
package/lib/.eslintrc.json
DELETED
package/lib/node-commonjs.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: [
|
|
5
|
-
"./_base",
|
|
6
|
-
"./base/commonjs",
|
|
7
|
-
"./plugins/import/import-commonjs",
|
|
8
|
-
"./node/commonjs",
|
|
9
|
-
].map(require.resolve),
|
|
10
|
-
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ["*.mjs"],
|
|
14
|
-
extends: [
|
|
15
|
-
"./_base",
|
|
16
|
-
"./base/module",
|
|
17
|
-
"./plugins/import/import-module",
|
|
18
|
-
"./node/module",
|
|
19
|
-
].map(require.resolve),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
files: ["*.cjs"],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
};
|
package/lib/node-module.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: [
|
|
5
|
-
"./_base",
|
|
6
|
-
"./base/module",
|
|
7
|
-
"./plugins/import/import-module",
|
|
8
|
-
"./node/module",
|
|
9
|
-
].map(require.resolve),
|
|
10
|
-
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ["*.cjs"],
|
|
14
|
-
extends: [
|
|
15
|
-
"./_base",
|
|
16
|
-
"./base/commonjs",
|
|
17
|
-
"./plugins/import/import-commonjs",
|
|
18
|
-
"./node/commonjs",
|
|
19
|
-
].map(require.resolve),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
files: ["*.mjs"],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
};
|
package/lib/root-commonjs.js
DELETED
package/lib/root-module.js
DELETED
package/lib/rules/modules/esm.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
// replaced by import/no-duplicates
|
|
6
|
-
"no-duplicate-imports": "off",
|
|
7
|
-
|
|
8
|
-
// https://eslint.org/docs/rules/no-restricted-exports
|
|
9
|
-
"no-restricted-exports": [
|
|
10
|
-
"error",
|
|
11
|
-
{
|
|
12
|
-
restrictDefaultExports: {
|
|
13
|
-
direct: false, // permits `export default` declarations
|
|
14
|
-
named: true, // restricts `export { foo as default };` declarations
|
|
15
|
-
defaultFrom: false, // permits `export { default } from 'foo';` declarations
|
|
16
|
-
namedFrom: false, // permits `export { foo as default } from 'foo';` declarations
|
|
17
|
-
namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
|
|
18
|
-
},
|
|
19
|
-
restrictedNamedExports: [
|
|
20
|
-
"then", // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
};
|