@pob/eslint-config 55.3.0 → 56.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 +14 -0
- package/lib/_base.js +9 -9
- package/lib/base/commonjs.js +3 -3
- package/lib/base/module.js +3 -3
- package/lib/index.js +8 -8
- package/lib/node/_base.js +24 -24
- package/lib/node/commonjs.js +7 -7
- package/lib/node/module.js +13 -13
- package/lib/node-commonjs.js +11 -11
- package/lib/node-module.js +11 -11
- package/lib/plugins/import/import-base.js +38 -38
- package/lib/plugins/import/import-commonjs.js +2 -2
- package/lib/plugins/import/import-module.js +2 -2
- package/lib/plugins/unicorn.js +115 -115
- package/lib/root-commonjs.js +3 -3
- package/lib/root-module.js +3 -3
- package/lib/rules/best-practices.js +174 -174
- package/lib/rules/code-quality.js +3 -3
- package/lib/rules/dev-only.js +4 -4
- package/lib/rules/errors.js +41 -41
- package/lib/rules/modules/base.js +2 -2
- package/lib/rules/modules/commonjs.js +3 -3
- package/lib/rules/modules/esm.js +5 -5
- package/lib/rules/style.js +8 -8
- package/package.json +1 -1
- package/utils.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [56.0.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v55.3.0...v56.0.0) (2024-05-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* use standard quotes
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* use standard quotes ([0083d81](https://github.com/christophehurpeau/eslint-config-pob/commit/0083d816bbe4e320eabe3c23a8d4edaa561df8a3))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [55.3.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v55.2.1...v55.3.0) (2024-05-05)
|
|
7
21
|
|
|
8
22
|
|
package/lib/_base.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
extends: [
|
|
5
|
-
|
|
5
|
+
"eslint:recommended",
|
|
6
6
|
...[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
"./plugins/unicorn",
|
|
8
|
+
"./rules/best-practices",
|
|
9
|
+
"./rules/code-quality",
|
|
10
|
+
"./rules/errors",
|
|
11
|
+
"./rules/style",
|
|
12
|
+
"./plugins/import/import-base",
|
|
13
|
+
"./plugins/import/import-commonjs",
|
|
14
14
|
].map(require.resolve),
|
|
15
15
|
],
|
|
16
16
|
};
|
package/lib/base/commonjs.js
CHANGED
package/lib/base/module.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
extends: [
|
|
4
|
+
extends: ["./_base", "./base/commonjs"].map(require.resolve),
|
|
5
5
|
|
|
6
6
|
overrides: [
|
|
7
7
|
{
|
|
8
|
-
files: [
|
|
9
|
-
extends: [
|
|
10
|
-
require.resolve
|
|
8
|
+
files: ["*.mjs"],
|
|
9
|
+
extends: ["./base/module", "./plugins/import/import-module"].map(
|
|
10
|
+
require.resolve
|
|
11
11
|
),
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
files: [
|
|
15
|
-
extends: [
|
|
16
|
-
require.resolve
|
|
14
|
+
files: ["*.cjs"],
|
|
15
|
+
extends: ["./base/commonjs", "./plugins/import/import-commonjs"].map(
|
|
16
|
+
require.resolve
|
|
17
17
|
),
|
|
18
18
|
},
|
|
19
19
|
],
|
package/lib/node/_base.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.overrideRules = {
|
|
4
4
|
// Disable rules already checked by import plugin
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
"n/no-unpublished-require": "off",
|
|
6
|
+
"n/no-extraneous-require": "off",
|
|
7
|
+
"n/no-unpublished-import": "off",
|
|
8
|
+
"n/no-extraneous-import": "off",
|
|
9
|
+
"n/no-missing-require": "off",
|
|
10
|
+
"n/no-missing-import": "off",
|
|
11
11
|
|
|
12
12
|
// Allow process.exit
|
|
13
|
-
|
|
13
|
+
"n/no-process-exit": "off",
|
|
14
14
|
|
|
15
15
|
// ensure deprecated eslint rules are disabled
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
"callback-return": "off",
|
|
17
|
+
"global-require": "off",
|
|
18
|
+
"handle-callback-err": "off",
|
|
19
|
+
"no-mixed-requires": "off",
|
|
20
|
+
"no-new-require": "off",
|
|
21
|
+
"no-path-concat": "off",
|
|
22
|
+
"no-process-env": "off",
|
|
23
|
+
"no-process-exit": "off",
|
|
24
|
+
"no-restricted-modules": "off",
|
|
25
|
+
"no-sync": "off",
|
|
26
26
|
|
|
27
27
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/import/extensions.md
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"import/extensions": [
|
|
29
|
+
"error",
|
|
30
|
+
"ignorePackages",
|
|
31
31
|
{
|
|
32
|
-
mjs:
|
|
33
|
-
cjs:
|
|
34
|
-
js:
|
|
32
|
+
mjs: "always",
|
|
33
|
+
cjs: "always",
|
|
34
|
+
js: "never",
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
37
|
};
|
package/lib/node/commonjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const { env, overrideRules } = require(
|
|
3
|
+
const { env, overrideRules } = require("./_base");
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
|
-
plugins: [
|
|
7
|
-
extends: [
|
|
6
|
+
plugins: ["n"],
|
|
7
|
+
extends: ["plugin:n/recommended-script"],
|
|
8
8
|
env,
|
|
9
9
|
|
|
10
10
|
parserOptions: {
|
|
@@ -17,8 +17,8 @@ module.exports = {
|
|
|
17
17
|
|
|
18
18
|
rules: {
|
|
19
19
|
...overrideRules,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
"unicorn/prefer-module": "off",
|
|
21
|
+
"n/no-new-require": "error",
|
|
22
|
+
"n/no-path-concat": "error",
|
|
23
23
|
},
|
|
24
24
|
};
|
package/lib/node/module.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const { env, overrideRules } = require(
|
|
3
|
+
const { env, overrideRules } = require("./_base");
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
|
-
plugins: [
|
|
7
|
-
extends: [
|
|
6
|
+
plugins: ["n"],
|
|
7
|
+
extends: ["plugin:n/recommended-module"],
|
|
8
8
|
parserOptions: {
|
|
9
|
-
sourceType:
|
|
9
|
+
sourceType: "module",
|
|
10
10
|
// https://node.green/#ES2020
|
|
11
11
|
// most 2020 features are supported in node 14
|
|
12
12
|
// top level await is introduced in 2022
|
|
@@ -16,17 +16,17 @@ module.exports = {
|
|
|
16
16
|
env,
|
|
17
17
|
rules: {
|
|
18
18
|
...overrideRules,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
"unicorn/prefer-module": "error",
|
|
20
|
+
"unicorn/import-index": "off",
|
|
21
21
|
|
|
22
22
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/import/extensions.md
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
"import/extensions": [
|
|
24
|
+
"error",
|
|
25
|
+
"ignorePackages",
|
|
26
26
|
{
|
|
27
|
-
mjs:
|
|
28
|
-
cjs:
|
|
29
|
-
js:
|
|
27
|
+
mjs: "always",
|
|
28
|
+
cjs: "always",
|
|
29
|
+
js: "always",
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
},
|
package/lib/node-commonjs.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
extends: [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"./_base",
|
|
6
|
+
"./base/commonjs",
|
|
7
|
+
"./plugins/import/import-commonjs",
|
|
8
|
+
"./node/commonjs",
|
|
9
9
|
].map(require.resolve),
|
|
10
10
|
|
|
11
11
|
overrides: [
|
|
12
12
|
{
|
|
13
|
-
files: [
|
|
13
|
+
files: ["*.mjs"],
|
|
14
14
|
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"./_base",
|
|
16
|
+
"./base/module",
|
|
17
|
+
"./plugins/import/import-module",
|
|
18
|
+
"./node/module",
|
|
19
19
|
].map(require.resolve),
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
files: [
|
|
22
|
+
files: ["*.cjs"],
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
package/lib/node-module.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
extends: [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"./_base",
|
|
6
|
+
"./base/module",
|
|
7
|
+
"./plugins/import/import-module",
|
|
8
|
+
"./node/module",
|
|
9
9
|
].map(require.resolve),
|
|
10
10
|
|
|
11
11
|
overrides: [
|
|
12
12
|
{
|
|
13
|
-
files: [
|
|
13
|
+
files: ["*.cjs"],
|
|
14
14
|
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"./_base",
|
|
16
|
+
"./base/commonjs",
|
|
17
|
+
"./plugins/import/import-commonjs",
|
|
18
|
+
"./node/commonjs",
|
|
19
19
|
].map(require.resolve),
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
files: [
|
|
22
|
+
files: ["*.mjs"],
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
plugins: [
|
|
4
|
+
plugins: ["import"],
|
|
5
5
|
|
|
6
6
|
settings: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"import/extensions": [".js", ".mjs"],
|
|
8
|
+
"import/core-modules": [],
|
|
9
|
+
"import/ignore": ["node_modules"],
|
|
10
10
|
},
|
|
11
11
|
|
|
12
12
|
rules: {
|
|
13
13
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
14
|
-
|
|
14
|
+
"import/no-unresolved": ["error", { commonjs: true, caseSensitive: true }],
|
|
15
15
|
|
|
16
16
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/named.md
|
|
17
|
-
|
|
17
|
+
"import/named": "error",
|
|
18
18
|
|
|
19
19
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
20
|
-
|
|
20
|
+
"import/export": "error",
|
|
21
21
|
|
|
22
22
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
23
|
-
|
|
23
|
+
"import/no-named-as-default": "error",
|
|
24
24
|
|
|
25
25
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
26
|
-
|
|
26
|
+
"import/no-named-as-default-member": "error",
|
|
27
27
|
|
|
28
28
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
29
|
-
|
|
29
|
+
"import/no-deprecated": "off",
|
|
30
30
|
|
|
31
31
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
32
|
-
|
|
32
|
+
"import/no-extraneous-dependencies": "error",
|
|
33
33
|
|
|
34
34
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
35
|
-
|
|
35
|
+
"import/no-mutable-exports": "error",
|
|
36
36
|
|
|
37
37
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
38
|
-
|
|
38
|
+
"import/no-amd": "error",
|
|
39
39
|
|
|
40
40
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
41
|
-
|
|
41
|
+
"import/first": "error",
|
|
42
42
|
|
|
43
43
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
44
|
-
|
|
44
|
+
"import/no-duplicates": "error",
|
|
45
45
|
|
|
46
46
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
47
|
-
|
|
47
|
+
"import/newline-after-import": "error",
|
|
48
48
|
|
|
49
49
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
50
|
-
|
|
50
|
+
"import/prefer-default-export": "off",
|
|
51
51
|
|
|
52
52
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
53
|
-
|
|
53
|
+
"import/no-absolute-path": "error",
|
|
54
54
|
|
|
55
55
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
56
|
-
|
|
56
|
+
"import/no-dynamic-require": "error",
|
|
57
57
|
|
|
58
58
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
59
|
-
|
|
59
|
+
"import/no-webpack-loader-syntax": "error",
|
|
60
60
|
|
|
61
61
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
62
|
-
|
|
62
|
+
"import/no-named-default": "error",
|
|
63
63
|
|
|
64
64
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-self-import.md
|
|
65
|
-
|
|
65
|
+
"import/no-self-import": "error",
|
|
66
66
|
|
|
67
67
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-cycle.md
|
|
68
|
-
|
|
68
|
+
"import/no-cycle": ["error", { maxDepth: "∞" }],
|
|
69
69
|
|
|
70
70
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md
|
|
71
|
-
|
|
71
|
+
"import/no-useless-path-segments": ["error", { commonjs: true }],
|
|
72
72
|
|
|
73
73
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md
|
|
74
|
-
|
|
74
|
+
"import/no-import-module-exports": "error",
|
|
75
75
|
|
|
76
76
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md
|
|
77
|
-
|
|
77
|
+
"import/no-relative-packages": "error",
|
|
78
78
|
|
|
79
79
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-empty-named-blocks.md
|
|
80
|
-
|
|
80
|
+
"import/no-empty-named-blocks": "error",
|
|
81
81
|
|
|
82
82
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
"import/order": [
|
|
84
|
+
"error",
|
|
85
85
|
{
|
|
86
86
|
groups: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
"builtin",
|
|
88
|
+
"external",
|
|
89
|
+
"internal",
|
|
90
|
+
"parent",
|
|
91
|
+
"sibling",
|
|
92
|
+
"index",
|
|
93
93
|
],
|
|
94
|
-
alphabetize: { order:
|
|
95
|
-
|
|
94
|
+
alphabetize: { order: "asc", caseInsensitive: false },
|
|
95
|
+
"newlines-between": "never",
|
|
96
96
|
},
|
|
97
97
|
],
|
|
98
98
|
},
|