@typescript-eslint/eslint-plugin 8.22.1-alpha.8 → 8.22.1-alpha.9
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.
@@ -119,7 +119,7 @@ const foo = <Foo props={{ bar: 1 } as Bar} />;
|
|
119
119
|
|
120
120
|
{/* insert option description */}
|
121
121
|
|
122
|
-
|
122
|
+
For example, this would prefer `const x: T[] = [ ... ];` to `const x = [ ... ] as T[];` (or similar with angle brackets).
|
123
123
|
|
124
124
|
The compiler will warn for excess properties of elements with this syntax, but not missing _required_ fields of those objects.
|
125
125
|
For example: `const x: {foo: number}[] = [{}];` will fail to compile, but `const x = [{}] as [{ foo: number }]` will succeed.
|
@@ -79,8 +79,6 @@ cond ? console.log('true') : console.error('false');
|
|
79
79
|
|
80
80
|
{/* insert option description */}
|
81
81
|
|
82
|
-
Whether to ignore "shorthand" `() =>` arrow functions: those without `{ ... }` braces.
|
83
|
-
|
84
82
|
It might be undesirable to wrap every arrow function shorthand expression.
|
85
83
|
Especially when using the Prettier formatter, which spreads such code across 3 lines instead of 1.
|
86
84
|
|
@@ -94,8 +92,6 @@ promise.then(value => window.postMessage(value));
|
|
94
92
|
|
95
93
|
{/* insert option description */}
|
96
94
|
|
97
|
-
Whether to ignore returns that start with the `void` operator.
|
98
|
-
|
99
95
|
It might be preferable to only use some distinct syntax
|
100
96
|
to explicitly mark the confusing but valid usage of void expressions.
|
101
97
|
This option allows void expressions which are explicitly wrapped in the `void` operator.
|
@@ -127,8 +123,6 @@ console.log(void alert('Hello, world!'));
|
|
127
123
|
|
128
124
|
{/* insert option description */}
|
129
125
|
|
130
|
-
Whether to ignore returns from functions with `void` return types when inside a function with a `void` return type.
|
131
|
-
|
132
126
|
Some projects prefer allowing functions that explicitly return `void` to return `void` expressions. Doing so allows more writing more succinct functions.
|
133
127
|
|
134
128
|
:::note
|
@@ -181,8 +181,6 @@ Also, if you would like to ignore all primitives types, you can set `ignorePrimi
|
|
181
181
|
|
182
182
|
{/* insert option description */}
|
183
183
|
|
184
|
-
Whether to ignore expressions that coerce a value into a boolean: `Boolean(...)`.
|
185
|
-
|
186
184
|
Incorrect code for `ignoreBooleanCoercion: false`, and correct code for `ignoreBooleanCoercion: true`:
|
187
185
|
|
188
186
|
```ts option='{ "ignoreBooleanCoercion": true }' showPlaygroundButton
|
@@ -148,8 +148,6 @@ const msg1 = `arg = ${arg}`;
|
|
148
148
|
|
149
149
|
{/* insert option description */}
|
150
150
|
|
151
|
-
Whether to allow additional types in template expressions.
|
152
|
-
|
153
151
|
This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier).
|
154
152
|
|
155
153
|
Examples of additional **correct** code for this rule with the default option `{ allow: [{ from: 'lib', name: 'Error' }, { from: 'lib', name: 'URL' }, { from: 'lib', name: 'URLSearchParams' }] }`:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
3
|
-
"version": "8.22.1-alpha.
|
3
|
+
"version": "8.22.1-alpha.9",
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -61,10 +61,10 @@
|
|
61
61
|
},
|
62
62
|
"dependencies": {
|
63
63
|
"@eslint-community/regexpp": "^4.10.0",
|
64
|
-
"@typescript-eslint/scope-manager": "8.22.1-alpha.
|
65
|
-
"@typescript-eslint/type-utils": "8.22.1-alpha.
|
66
|
-
"@typescript-eslint/utils": "8.22.1-alpha.
|
67
|
-
"@typescript-eslint/visitor-keys": "8.22.1-alpha.
|
64
|
+
"@typescript-eslint/scope-manager": "8.22.1-alpha.9",
|
65
|
+
"@typescript-eslint/type-utils": "8.22.1-alpha.9",
|
66
|
+
"@typescript-eslint/utils": "8.22.1-alpha.9",
|
67
|
+
"@typescript-eslint/visitor-keys": "8.22.1-alpha.9",
|
68
68
|
"graphemer": "^1.4.0",
|
69
69
|
"ignore": "^5.3.1",
|
70
70
|
"natural-compare": "^1.4.0",
|
@@ -75,8 +75,8 @@
|
|
75
75
|
"@types/marked": "^5.0.2",
|
76
76
|
"@types/mdast": "^4.0.3",
|
77
77
|
"@types/natural-compare": "*",
|
78
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.22.1-alpha.
|
79
|
-
"@typescript-eslint/rule-tester": "8.22.1-alpha.
|
78
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.22.1-alpha.9",
|
79
|
+
"@typescript-eslint/rule-tester": "8.22.1-alpha.9",
|
80
80
|
"ajv": "^6.12.6",
|
81
81
|
"cross-env": "^7.0.3",
|
82
82
|
"cross-fetch": "*",
|