@josundt/eslint-config 5.2.10 → 5.3.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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@josundt/eslint-config",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.3.1",
|
4
4
|
"description": "ESLint ruleset with required plugins for josundt TypeScript projects",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -27,22 +27,22 @@
|
|
27
27
|
"utils/**/*.js"
|
28
28
|
],
|
29
29
|
"peerDependencies": {
|
30
|
-
"typescript": ">=5.
|
30
|
+
"typescript": ">=5.3.2"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@josundt/prettier-config": "^3.0
|
34
|
-
"@typescript-eslint/eslint-plugin": "6.
|
35
|
-
"@typescript-eslint/parser": "6.
|
36
|
-
"eslint": "8.
|
37
|
-
"eslint-import-resolver-typescript": "3.6.
|
38
|
-
"eslint-plugin-deprecation": "
|
33
|
+
"@josundt/prettier-config": "^3.1.0",
|
34
|
+
"@typescript-eslint/eslint-plugin": "6.13.1",
|
35
|
+
"@typescript-eslint/parser": "6.13.1",
|
36
|
+
"eslint": "8.54.0",
|
37
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
38
|
+
"eslint-plugin-deprecation": "2.0.0",
|
39
39
|
"eslint-plugin-eslint-comments": "3.2.0",
|
40
|
-
"eslint-plugin-import": "2.
|
40
|
+
"eslint-plugin-import": "2.29.0",
|
41
41
|
"eslint-plugin-jasmine": "4.1.3",
|
42
|
-
"eslint-plugin-jest": "27.
|
43
|
-
"eslint-plugin-jsdoc": "46.
|
42
|
+
"eslint-plugin-jest": "27.6.0",
|
43
|
+
"eslint-plugin-jsdoc": "46.9.0",
|
44
44
|
"eslint-plugin-no-lookahead-lookbehind-regexp": "0.3.0",
|
45
|
-
"eslint-plugin-prettier": "5.0.
|
46
|
-
"eslint-plugin-unicorn": "
|
45
|
+
"eslint-plugin-prettier": "5.0.1",
|
46
|
+
"eslint-plugin-unicorn": "49.0.0"
|
47
47
|
}
|
48
48
|
}
|
package/rules/eslint.js
CHANGED
@@ -150,6 +150,16 @@ module.exports = {
|
|
150
150
|
"error",
|
151
151
|
{ destructuring: "all", ignoreReadBeforeAssign: false }
|
152
152
|
],
|
153
|
+
"prefer-destructuring": [
|
154
|
+
"warn",
|
155
|
+
{
|
156
|
+
array: true,
|
157
|
+
object: true
|
158
|
+
},
|
159
|
+
{
|
160
|
+
enforceForRenamedProperties: false
|
161
|
+
}
|
162
|
+
],
|
153
163
|
"prefer-exponentiation-operator": "error",
|
154
164
|
"prefer-object-spread": "error",
|
155
165
|
"prefer-promise-reject-errors": "error",
|
@@ -10,7 +10,7 @@ const eslintRules = eslintRuleSet.rules;
|
|
10
10
|
// If the map value is an object:
|
11
11
|
// The object will be merged merged with standard rule (rule object 1).
|
12
12
|
// If the map value is an array:
|
13
|
-
// The items of the array will be
|
13
|
+
// The options items of the array (expected to be object literals or undefined) will be merged with the options items of the standard rule (expected to be object literals or undefined).
|
14
14
|
// If the map value is a function:
|
15
15
|
// The standard eslint options object will be passed as parameters, the return statement will be added as options.
|
16
16
|
|
@@ -76,6 +76,10 @@ const extensions = new Map([
|
|
76
76
|
["no-unused-vars", false],
|
77
77
|
["no-use-before-define", false],
|
78
78
|
["no-useless-constructor", false],
|
79
|
+
[
|
80
|
+
"prefer-destructuring",
|
81
|
+
[{}, { enforceForDeclarationWithTypeAnnotation: false }]
|
82
|
+
],
|
79
83
|
["require-await", true],
|
80
84
|
["return-await", true]
|
81
85
|
]);
|
@@ -105,7 +109,19 @@ module.exports.typescriptEslintExtensionrules = Object.entries(
|
|
105
109
|
// Ensure value is array if only severity string:
|
106
110
|
value = Array.isArray(value) ? [...value] : [value];
|
107
111
|
if (Array.isArray(extension)) {
|
108
|
-
value
|
112
|
+
const [severity, ...orgOpts] = value;
|
113
|
+
const extOpts = extension;
|
114
|
+
value = [severity];
|
115
|
+
for (
|
116
|
+
let i = 0;
|
117
|
+
i < Math.max(orgOpts.length, extOpts.length);
|
118
|
+
i++
|
119
|
+
) {
|
120
|
+
value.push({
|
121
|
+
...(orgOpts[i] ?? {}),
|
122
|
+
...(extOpts[i] ?? {})
|
123
|
+
});
|
124
|
+
}
|
109
125
|
} else if (typeof extension === "object") {
|
110
126
|
// If array only contains severity string, push object
|
111
127
|
if (value.length === 1) {
|