@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/lib/rules/dev-only.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
|
-
|
|
5
|
+
"no-console": "off",
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
"import/no-extraneous-dependencies": [
|
|
8
|
+
"error",
|
|
9
9
|
{
|
|
10
10
|
devDependencies: true,
|
|
11
11
|
},
|
package/lib/rules/errors.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
5
|
// https://eslint.org/docs/rules/for-direction
|
|
6
|
-
|
|
6
|
+
"for-direction": "error",
|
|
7
7
|
|
|
8
8
|
// https://eslint.org/docs/rules/getter-return
|
|
9
|
-
|
|
9
|
+
"getter-return": ["error", { allowImplicit: true }],
|
|
10
10
|
|
|
11
11
|
// https://eslint.org/docs/rules/no-async-promise-executor
|
|
12
|
-
|
|
12
|
+
"no-async-promise-executor": "error",
|
|
13
13
|
|
|
14
14
|
// https://eslint.org/docs/rules/no-compare-neg-zero
|
|
15
|
-
|
|
15
|
+
"no-compare-neg-zero": "error",
|
|
16
16
|
|
|
17
17
|
// https://eslint.org/docs/rules/no-cond-assign
|
|
18
|
-
|
|
18
|
+
"no-cond-assign": ["error", "always"],
|
|
19
19
|
|
|
20
20
|
// https://eslint.org/docs/rules/no-console
|
|
21
|
-
|
|
21
|
+
"no-console": "warn",
|
|
22
22
|
|
|
23
23
|
// https://eslint.org/docs/rules/no-control-regex
|
|
24
|
-
|
|
24
|
+
"no-control-regex": "error",
|
|
25
25
|
|
|
26
26
|
// https://eslint.org/docs/rules/no-debugger
|
|
27
|
-
|
|
27
|
+
"no-debugger": "error",
|
|
28
28
|
|
|
29
29
|
// https://eslint.org/docs/rules/no-dupe-args
|
|
30
|
-
|
|
30
|
+
"no-dupe-args": "error",
|
|
31
31
|
|
|
32
32
|
// https://eslint.org/docs/rules/no-dupe-else-if
|
|
33
|
-
|
|
33
|
+
"no-dupe-else-if": "error",
|
|
34
34
|
|
|
35
35
|
// https://eslint.org/docs/rules/no-dupe-keys
|
|
36
|
-
|
|
36
|
+
"no-dupe-keys": "error",
|
|
37
37
|
|
|
38
38
|
// https://eslint.org/docs/rules/no-duplicate-case
|
|
39
|
-
|
|
39
|
+
"no-duplicate-case": "error",
|
|
40
40
|
|
|
41
41
|
// https://eslint.org/docs/rules/no-empty
|
|
42
|
-
|
|
42
|
+
"no-empty": "off",
|
|
43
43
|
|
|
44
44
|
// https://eslint.org/docs/rules/no-empty-character-class
|
|
45
|
-
|
|
45
|
+
"no-empty-character-class": "error",
|
|
46
46
|
|
|
47
47
|
// https://eslint.org/docs/rules/no-ex-assign
|
|
48
|
-
|
|
48
|
+
"no-ex-assign": "error",
|
|
49
49
|
|
|
50
50
|
// https://eslint.org/docs/rules/no-extra-boolean-cast
|
|
51
|
-
|
|
51
|
+
"no-extra-boolean-cast": "error",
|
|
52
52
|
|
|
53
53
|
// https://eslint.org/docs/rules/no-func-assign
|
|
54
|
-
|
|
54
|
+
"no-func-assign": "error",
|
|
55
55
|
|
|
56
56
|
// https://eslint.org/docs/rules/no-import-assign
|
|
57
|
-
|
|
57
|
+
"no-import-assign": "error",
|
|
58
58
|
|
|
59
59
|
// https://eslint.org/docs/rules/no-inner-declarations
|
|
60
|
-
|
|
60
|
+
"no-inner-declarations": "error",
|
|
61
61
|
|
|
62
62
|
// https://eslint.org/docs/rules/no-invalid-regexp
|
|
63
|
-
|
|
63
|
+
"no-invalid-regexp": "error",
|
|
64
64
|
|
|
65
65
|
// https://eslint.org/docs/rules/no-irregular-whitespace
|
|
66
|
-
|
|
66
|
+
"no-irregular-whitespace": "error",
|
|
67
67
|
|
|
68
68
|
// https://eslint.org/docs/rules/no-loss-of-precision
|
|
69
|
-
|
|
69
|
+
"no-loss-of-precision": "error",
|
|
70
70
|
|
|
71
71
|
// https://eslint.org/docs/rules/no-misleading-character-class
|
|
72
|
-
|
|
72
|
+
"no-misleading-character-class": "error",
|
|
73
73
|
|
|
74
74
|
// https://eslint.org/docs/rules/no-obj-calls
|
|
75
|
-
|
|
75
|
+
"no-obj-calls": "error",
|
|
76
76
|
|
|
77
77
|
// https://eslint.org/docs/rules/no-new-native-nonconstructor
|
|
78
|
-
|
|
78
|
+
"no-new-native-nonconstructor": "error",
|
|
79
79
|
|
|
80
80
|
// https://eslint.org/docs/rules/no-promise-executor-return
|
|
81
|
-
|
|
81
|
+
"no-promise-executor-return": "error",
|
|
82
82
|
|
|
83
83
|
// https://eslint.org/docs/rules/no-prototype-builtins
|
|
84
|
-
|
|
84
|
+
"no-prototype-builtins": "error",
|
|
85
85
|
|
|
86
86
|
// https://eslint.org/docs/rules/no-regex-spaces
|
|
87
|
-
|
|
87
|
+
"no-regex-spaces": "error",
|
|
88
88
|
|
|
89
89
|
// https://eslint.org/docs/rules/no-setter-return
|
|
90
|
-
|
|
90
|
+
"no-setter-return": "error",
|
|
91
91
|
|
|
92
92
|
// https://eslint.org/docs/rules/no-sparse-arrays
|
|
93
|
-
|
|
93
|
+
"no-sparse-arrays": "error",
|
|
94
94
|
|
|
95
95
|
// https://eslint.org/docs/rules/no-template-curly-in-string
|
|
96
|
-
|
|
96
|
+
"no-template-curly-in-string": "error",
|
|
97
97
|
|
|
98
98
|
// https://eslint.org/docs/rules/no-unreachable
|
|
99
|
-
|
|
99
|
+
"no-unreachable": "error",
|
|
100
100
|
|
|
101
101
|
// https://eslint.org/docs/rules/no-unreachable-loop
|
|
102
|
-
|
|
102
|
+
"no-unreachable-loop": "error",
|
|
103
103
|
|
|
104
104
|
// https://eslint.org/docs/rules/no-unsafe-finally
|
|
105
|
-
|
|
105
|
+
"no-unsafe-finally": "error",
|
|
106
106
|
|
|
107
107
|
// https://eslint.org/docs/rules/no-unsafe-negation
|
|
108
|
-
|
|
108
|
+
"no-unsafe-negation": "error",
|
|
109
109
|
|
|
110
110
|
// https://eslint.org/docs/rules/no-unsafe-optional-chaining
|
|
111
|
-
|
|
111
|
+
"no-unsafe-optional-chaining": "error",
|
|
112
112
|
|
|
113
113
|
// https://eslint.org/docs/rules/no-unused-private-class-members
|
|
114
|
-
|
|
114
|
+
"no-unused-private-class-members": "error",
|
|
115
115
|
|
|
116
116
|
// https://eslint.org/docs/rules/no-useless-backreference
|
|
117
|
-
|
|
117
|
+
"no-useless-backreference": "error",
|
|
118
118
|
|
|
119
119
|
// https://eslint.org/docs/rules/use-isnan
|
|
120
|
-
|
|
120
|
+
"use-isnan": "error",
|
|
121
121
|
|
|
122
122
|
// https://eslint.org/docs/rules/valid-typeof
|
|
123
|
-
|
|
123
|
+
"valid-typeof": "error",
|
|
124
124
|
},
|
|
125
125
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
5
|
// https://eslint.org/docs/rules/global-require
|
|
6
|
-
|
|
6
|
+
"global-require": "error",
|
|
7
7
|
|
|
8
8
|
// disallow use of new operator with the require function
|
|
9
|
-
|
|
9
|
+
"no-new-require": "error",
|
|
10
10
|
},
|
|
11
11
|
};
|
package/lib/rules/modules/esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
5
|
// replaced by import/no-duplicates
|
|
6
|
-
|
|
6
|
+
"no-duplicate-imports": "off",
|
|
7
7
|
|
|
8
8
|
// https://eslint.org/docs/rules/no-restricted-exports
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
"no-restricted-exports": [
|
|
10
|
+
"error",
|
|
11
11
|
{
|
|
12
12
|
restrictDefaultExports: {
|
|
13
13
|
direct: false, // permits `export default` declarations
|
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
|
17
17
|
namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
|
|
18
18
|
},
|
|
19
19
|
restrictedNamedExports: [
|
|
20
|
-
|
|
20
|
+
"then", // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
|
|
21
21
|
],
|
|
22
22
|
},
|
|
23
23
|
],
|
package/lib/rules/style.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
rules: {
|
|
5
5
|
// changed properties: 'never' to properties: 'always' ; true to 'ignoreDestructuring': false
|
|
6
6
|
// http://eslint.org/docs/rules/camelcase
|
|
7
|
-
camelcase: [
|
|
7
|
+
camelcase: ["error", { properties: "always", ignoreDestructuring: false }],
|
|
8
8
|
|
|
9
9
|
// http://eslint.org/docs/rules/object-shorthand
|
|
10
|
-
|
|
10
|
+
"object-shorthand": ["error", "always"],
|
|
11
11
|
|
|
12
12
|
// https://github.com/prettier/eslint-config-prettier#curly
|
|
13
13
|
// prettier doesn't enforce {} with multiline
|
|
14
|
-
curly: [
|
|
14
|
+
curly: ["warn", "multi-line"],
|
|
15
15
|
|
|
16
16
|
// https://github.com/prettier/eslint-config-prettier#quotes
|
|
17
17
|
// prettier doesn't change backtick to single
|
|
18
18
|
quotes: [
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
"warn",
|
|
20
|
+
"double",
|
|
21
21
|
{ avoidEscape: true, allowTemplateLiterals: false },
|
|
22
22
|
],
|
|
23
23
|
|
|
24
24
|
/* disabled rules */
|
|
25
25
|
|
|
26
26
|
// http://eslint.org/docs/rules/no-else-return
|
|
27
|
-
|
|
27
|
+
"no-else-return": "off",
|
|
28
28
|
|
|
29
29
|
// http://eslint.org/docs/rules/arrow-body-style
|
|
30
|
-
|
|
30
|
+
"arrow-body-style": "off",
|
|
31
31
|
},
|
|
32
32
|
};
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
const isVSCode =
|
|
4
4
|
process.argv &&
|
|
5
|
-
process.argv.some((argv) => argv.includes(
|
|
5
|
+
process.argv.some((argv) => argv.includes("dbaeumer.vscode-eslint"));
|
|
6
6
|
|
|
7
|
-
exports.enableIfVSCode = (ruleLevel) => (isVSCode ? ruleLevel :
|
|
7
|
+
exports.enableIfVSCode = (ruleLevel) => (isVSCode ? ruleLevel : "off");
|