@josundt/eslint-config 5.2.2 → 5.2.10
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.2.
|
3
|
+
"version": "5.2.10",
|
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.2.2"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@josundt/prettier-config": "^
|
34
|
-
"@typescript-eslint/eslint-plugin": "5.
|
35
|
-
"@typescript-eslint/parser": "5.
|
36
|
-
"eslint": "8.
|
37
|
-
"eslint-import-resolver-typescript": "3.
|
38
|
-
"eslint-plugin-deprecation": "1.
|
33
|
+
"@josundt/prettier-config": "^3.0.3",
|
34
|
+
"@typescript-eslint/eslint-plugin": "6.5.0",
|
35
|
+
"@typescript-eslint/parser": "6.5.0",
|
36
|
+
"eslint": "8.48.0",
|
37
|
+
"eslint-import-resolver-typescript": "3.6.0",
|
38
|
+
"eslint-plugin-deprecation": "1.5.0",
|
39
39
|
"eslint-plugin-eslint-comments": "3.2.0",
|
40
|
-
"eslint-plugin-import": "2.
|
40
|
+
"eslint-plugin-import": "2.28.1",
|
41
41
|
"eslint-plugin-jasmine": "4.1.3",
|
42
|
-
"eslint-plugin-jest": "27.2.
|
43
|
-
"eslint-plugin-jsdoc": "
|
44
|
-
"eslint-plugin-no-lookahead-lookbehind-regexp": "0.
|
45
|
-
"eslint-plugin-prettier": "
|
46
|
-
"eslint-plugin-unicorn": "
|
42
|
+
"eslint-plugin-jest": "27.2.3",
|
43
|
+
"eslint-plugin-jsdoc": "46.5.0",
|
44
|
+
"eslint-plugin-no-lookahead-lookbehind-regexp": "0.3.0",
|
45
|
+
"eslint-plugin-prettier": "5.0.0",
|
46
|
+
"eslint-plugin-unicorn": "48.0.1"
|
47
47
|
}
|
48
48
|
}
|
package/rules/eslint.js
CHANGED
@@ -3,7 +3,7 @@ module.exports = {
|
|
3
3
|
rules: {
|
4
4
|
"arrow-body-style": "error",
|
5
5
|
"arrow-parens": ["error", "as-needed"],
|
6
|
-
"class-methods-use-this": "off", // Warn when methods could be static
|
6
|
+
"class-methods-use-this": ["off", { enforceForClassFields: true }], // Warn when methods could be static
|
7
7
|
"complexity": ["warn", { max: 20 }],
|
8
8
|
"curly": "error",
|
9
9
|
"default-case-last": "error",
|
@@ -5,8 +5,8 @@ const eslintRules = eslintRuleSet.rules;
|
|
5
5
|
|
6
6
|
// Map of all the typescript-eslint extensions.
|
7
7
|
// If extension rule has additional properties compared to standard eslint rule:
|
8
|
-
// If the map value is
|
9
|
-
//
|
8
|
+
// If the map value is a boolean:
|
9
|
+
// If true the options from the standard rule will be used as is; if false the rule will be switched off.
|
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:
|
@@ -15,6 +15,14 @@ const eslintRules = eslintRuleSet.rules;
|
|
15
15
|
// The standard eslint options object will be passed as parameters, the return statement will be added as options.
|
16
16
|
|
17
17
|
const extensions = new Map([
|
18
|
+
[
|
19
|
+
"class-methods-use-this",
|
20
|
+
false
|
21
|
+
// {
|
22
|
+
// ignoreOverrideMethods: false,
|
23
|
+
// ignoreClassesThatImplementAnInterface: false
|
24
|
+
// }
|
25
|
+
],
|
18
26
|
["default-param-last", true],
|
19
27
|
[
|
20
28
|
"dot-notation",
|
@@ -33,7 +41,7 @@ const extensions = new Map([
|
|
33
41
|
],
|
34
42
|
["no-array-constructor", true],
|
35
43
|
["no-dupe-class-members", true],
|
36
|
-
["no-duplicate-imports",
|
44
|
+
["no-duplicate-imports", false], // typescript-eslint 5.25.0: deprecated in favour of import/no-duplicates
|
37
45
|
[
|
38
46
|
"no-empty-function",
|
39
47
|
{
|
@@ -21,7 +21,12 @@ const rules = {
|
|
21
21
|
}
|
22
22
|
],
|
23
23
|
"ban-tslint-comment": "error", // No longer use tslint - remove rules
|
24
|
-
"ban-types":
|
24
|
+
"ban-types": [
|
25
|
+
"error",
|
26
|
+
{
|
27
|
+
// Enable additional/disable default disabled types here
|
28
|
+
}
|
29
|
+
],
|
25
30
|
"class-literal-property-style": "off",
|
26
31
|
"consistent-generic-constructors": ["off", "constructor"],
|
27
32
|
"consistent-indexed-object-style": ["error", "record"],
|
@@ -191,7 +196,6 @@ const rules = {
|
|
191
196
|
allowThrowingUnknown: true // Default is to allow throwing values of type unknown
|
192
197
|
}
|
193
198
|
],
|
194
|
-
"no-type-alias": "off",
|
195
199
|
"no-unnecessary-boolean-literal-compare": "error",
|
196
200
|
"no-unnecessary-condition": "off", // allow runtime null checks etc even if reported not necessary by type system
|
197
201
|
"no-unnecessary-qualifier": "error",
|
@@ -226,7 +230,13 @@ const rules = {
|
|
226
230
|
{
|
227
231
|
ignoreConditionalTests: true,
|
228
232
|
ignoreTernaryTests: true,
|
229
|
-
ignoreMixedLogicalExpressions: true
|
233
|
+
ignoreMixedLogicalExpressions: true,
|
234
|
+
ignorePrimitives: {
|
235
|
+
string: false,
|
236
|
+
number: false,
|
237
|
+
bigint: false,
|
238
|
+
boolean: false
|
239
|
+
}
|
230
240
|
}
|
231
241
|
],
|
232
242
|
"prefer-optional-chain": "error",
|
@@ -238,11 +248,16 @@ const rules = {
|
|
238
248
|
"prefer-string-starts-ends-with": "error",
|
239
249
|
"prefer-ts-expect-error": "error",
|
240
250
|
"promise-function-async": "off",
|
241
|
-
"require-array-sort-compare":
|
251
|
+
"require-array-sort-compare": [
|
252
|
+
"error",
|
253
|
+
{
|
254
|
+
ignoreStringArrays: false
|
255
|
+
}
|
256
|
+
],
|
242
257
|
"restrict-plus-operands": [
|
243
258
|
"error",
|
244
259
|
{
|
245
|
-
|
260
|
+
skipCompoundAssignments: false,
|
246
261
|
allowAny: false
|
247
262
|
}
|
248
263
|
],
|