@typescript-eslint/eslint-plugin 6.8.1-alpha.3 → 6.8.1-alpha.5
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.
|
@@ -20,10 +20,16 @@ function f(a = 0, b: number) {}
|
|
|
20
20
|
function f(a: number, b = 0, c: number) {}
|
|
21
21
|
function f(a: number, b?: number, c: number) {}
|
|
22
22
|
class Foo {
|
|
23
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
public a = 10,
|
|
25
|
+
private b: number,
|
|
26
|
+
) {}
|
|
24
27
|
}
|
|
25
28
|
class Foo {
|
|
26
|
-
constructor(
|
|
29
|
+
constructor(
|
|
30
|
+
public a?: number,
|
|
31
|
+
private b: number,
|
|
32
|
+
) {}
|
|
27
33
|
}
|
|
28
34
|
```
|
|
29
35
|
|
|
@@ -38,9 +44,15 @@ function f(a: number, b?: number) {}
|
|
|
38
44
|
function f(a: number, b?: number, c = 0) {}
|
|
39
45
|
function f(a: number, b = 0, c?: number) {}
|
|
40
46
|
class Foo {
|
|
41
|
-
constructor(
|
|
47
|
+
constructor(
|
|
48
|
+
public a,
|
|
49
|
+
private b = 0,
|
|
50
|
+
) {}
|
|
42
51
|
}
|
|
43
52
|
class Foo {
|
|
44
|
-
constructor(
|
|
53
|
+
constructor(
|
|
54
|
+
public a,
|
|
55
|
+
private b?: number,
|
|
56
|
+
) {}
|
|
45
57
|
}
|
|
46
58
|
```
|
|
@@ -209,14 +209,14 @@ Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions
|
|
|
209
209
|
#### ❌ Incorrect
|
|
210
210
|
|
|
211
211
|
```ts
|
|
212
|
-
const func = (value: number) => ({ type: 'X', value } as any
|
|
213
|
-
const func = (value: number) => ({ type: 'X', value } as Action
|
|
212
|
+
const func = (value: number) => ({ type: 'X', value }) as any;
|
|
213
|
+
const func = (value: number) => ({ type: 'X', value }) as Action;
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
#### ✅ Correct
|
|
217
217
|
|
|
218
218
|
```ts
|
|
219
|
-
const func = (value: number) => ({ foo: 'bar', value } as const
|
|
219
|
+
const func = (value: number) => ({ foo: 'bar', value }) as const;
|
|
220
220
|
const func = () => x as const;
|
|
221
221
|
```
|
|
222
222
|
|
|
@@ -90,7 +90,10 @@ The following patterns are considered correct with the default options `{ access
|
|
|
90
90
|
|
|
91
91
|
```ts
|
|
92
92
|
class Animal {
|
|
93
|
-
public constructor(
|
|
93
|
+
public constructor(
|
|
94
|
+
public breed,
|
|
95
|
+
name,
|
|
96
|
+
) {
|
|
94
97
|
// Parameter property and constructor
|
|
95
98
|
this.animalName = name;
|
|
96
99
|
}
|
|
@@ -113,7 +116,10 @@ The following patterns are considered incorrect with the accessibility set to **
|
|
|
113
116
|
|
|
114
117
|
```ts
|
|
115
118
|
class Animal {
|
|
116
|
-
public constructor(
|
|
119
|
+
public constructor(
|
|
120
|
+
public breed,
|
|
121
|
+
name,
|
|
122
|
+
) {
|
|
117
123
|
// Parameter property and constructor
|
|
118
124
|
this.animalName = name;
|
|
119
125
|
}
|
|
@@ -136,7 +142,10 @@ The following patterns are considered correct with the accessibility set to **no
|
|
|
136
142
|
|
|
137
143
|
```ts
|
|
138
144
|
class Animal {
|
|
139
|
-
constructor(
|
|
145
|
+
constructor(
|
|
146
|
+
protected breed,
|
|
147
|
+
name,
|
|
148
|
+
) {
|
|
140
149
|
// Parameter property and constructor
|
|
141
150
|
this.name = name;
|
|
142
151
|
}
|
|
@@ -131,11 +131,11 @@ export const bar = () => 1;
|
|
|
131
131
|
#### ✅ Correct
|
|
132
132
|
|
|
133
133
|
```ts
|
|
134
|
-
export const func = (value: number) => ({ type: 'X', value } as const
|
|
134
|
+
export const func = (value: number) => ({ type: 'X', value }) as const;
|
|
135
135
|
export const foo = () =>
|
|
136
136
|
({
|
|
137
137
|
bar: true,
|
|
138
|
-
} as const
|
|
138
|
+
}) as const;
|
|
139
139
|
export const bar = () => 1 as const;
|
|
140
140
|
```
|
|
141
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
|
3
|
-
"version": "6.8.1-alpha.
|
|
3
|
+
"version": "6.8.1-alpha.5+0f11c18ed",
|
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@eslint-community/regexpp": "^4.5.1",
|
|
60
|
-
"@typescript-eslint/scope-manager": "6.8.1-alpha.
|
|
61
|
-
"@typescript-eslint/type-utils": "6.8.1-alpha.
|
|
62
|
-
"@typescript-eslint/utils": "6.8.1-alpha.
|
|
63
|
-
"@typescript-eslint/visitor-keys": "6.8.1-alpha.
|
|
60
|
+
"@typescript-eslint/scope-manager": "6.8.1-alpha.5+0f11c18ed",
|
|
61
|
+
"@typescript-eslint/type-utils": "6.8.1-alpha.5+0f11c18ed",
|
|
62
|
+
"@typescript-eslint/utils": "6.8.1-alpha.5+0f11c18ed",
|
|
63
|
+
"@typescript-eslint/visitor-keys": "6.8.1-alpha.5+0f11c18ed",
|
|
64
64
|
"debug": "^4.3.4",
|
|
65
65
|
"graphemer": "^1.4.0",
|
|
66
66
|
"ignore": "^5.2.4",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"ts-api-utils": "^1.0.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
+
"@prettier/sync": "*",
|
|
72
73
|
"@types/debug": "*",
|
|
73
74
|
"@types/marked": "*",
|
|
74
75
|
"@types/natural-compare": "*",
|
|
75
|
-
"@types/prettier": "*",
|
|
76
76
|
"@typescript-eslint/rule-schema-to-typescript-types": "6.8.0",
|
|
77
|
-
"@typescript-eslint/rule-tester": "6.8.1-alpha.
|
|
77
|
+
"@typescript-eslint/rule-tester": "6.8.1-alpha.5+0f11c18ed",
|
|
78
78
|
"ajv": "^6.12.6",
|
|
79
79
|
"chalk": "^5.3.0",
|
|
80
80
|
"cross-fetch": "*",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"json-schema": "*",
|
|
85
85
|
"markdown-table": "^3.0.3",
|
|
86
86
|
"marked": "^5.1.1",
|
|
87
|
-
"prettier": "^
|
|
87
|
+
"prettier": "^3.0.3",
|
|
88
88
|
"rimraf": "*",
|
|
89
89
|
"title-case": "^3.0.3",
|
|
90
90
|
"tsx": "*",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"type": "opencollective",
|
|
104
104
|
"url": "https://opencollective.com/typescript-eslint"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "0f11c18ed634b9551045b7f5dc853bc80037fd9c"
|
|
107
107
|
}
|