@typescript-eslint/eslint-plugin 8.2.1-alpha.13 → 8.2.1-alpha.15
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.
@@ -55,6 +55,8 @@ const msg3 = `stringWithKindProp = ${stringWithKindProp}`;
|
|
55
55
|
|
56
56
|
### `allowNumber`
|
57
57
|
|
58
|
+
Whether to allow `number` typed values in template expressions.
|
59
|
+
|
58
60
|
Examples of additional **correct** code for this rule with `{ allowNumber: true }`:
|
59
61
|
|
60
62
|
```ts option='{ "allowNumber": true }' showPlaygroundButton
|
@@ -65,8 +67,14 @@ const msg2 = `arg = ${arg || 'zero'}`;
|
|
65
67
|
|
66
68
|
This option controls both numbers and BigInts.
|
67
69
|
|
70
|
+
We recommend avoiding using this option if you use any floating point numbers.
|
71
|
+
Although `` `${1}` `` evaluates to `'1'`, `` `${0.1 + 0.2}` `` evaluates to `'0.30000000000000004'`.
|
72
|
+
Consider using [`.toFixed()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) or [`.toPrecision()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) instead.
|
73
|
+
|
68
74
|
### `allowBoolean`
|
69
75
|
|
76
|
+
Whether to allow Boolean typed values in template expressions.
|
77
|
+
|
70
78
|
Examples of additional **correct** code for this rule with `{ allowBoolean: true }`:
|
71
79
|
|
72
80
|
```ts option='{ "allowBoolean": true }' showPlaygroundButton
|
@@ -77,6 +85,8 @@ const msg2 = `arg = ${arg || 'not truthy'}`;
|
|
77
85
|
|
78
86
|
### `allowAny`
|
79
87
|
|
88
|
+
Whether to `any` typed values in template expressions.
|
89
|
+
|
80
90
|
Examples of additional **correct** code for this rule with `{ allowAny: true }`:
|
81
91
|
|
82
92
|
```ts option='{ "allowAny": true }' showPlaygroundButton
|
@@ -87,6 +97,8 @@ const msg2 = `arg = ${user.name || 'the user with no name'}`;
|
|
87
97
|
|
88
98
|
### `allowNullish`
|
89
99
|
|
100
|
+
Whether to allow `null` or `undefined` typed values in template expressions.
|
101
|
+
|
90
102
|
Examples of additional **correct** code for this rule with `{ allowNullish: true }`:
|
91
103
|
|
92
104
|
```ts option='{ "allowNullish": true }' showPlaygroundButton
|
@@ -96,6 +108,8 @@ const msg1 = `arg = ${arg}`;
|
|
96
108
|
|
97
109
|
### `allowRegExp`
|
98
110
|
|
111
|
+
Whether to allow `RegExp` typed values in template expressions.
|
112
|
+
|
99
113
|
Examples of additional **correct** code for this rule with `{ allowRegExp: true }`:
|
100
114
|
|
101
115
|
```ts option='{ "allowRegExp": true }' showPlaygroundButton
|
@@ -110,6 +124,8 @@ const msg1 = `arg = ${arg}`;
|
|
110
124
|
|
111
125
|
### `allowNever`
|
112
126
|
|
127
|
+
Whether to `never` typed values in template expressions.
|
128
|
+
|
113
129
|
Examples of additional **correct** code for this rule with `{ allowNever: true }`:
|
114
130
|
|
115
131
|
```ts option='{ "allowNever": true }' showPlaygroundButton
|
@@ -119,6 +135,8 @@ const msg1 = typeof arg === 'string' ? arg : `arg = ${arg}`;
|
|
119
135
|
|
120
136
|
### `allowArray`
|
121
137
|
|
138
|
+
Whether to `Array` typed values in template expressions.
|
139
|
+
|
122
140
|
Examples of additional **correct** code for this rule with `{ allowArray: true }`:
|
123
141
|
|
124
142
|
```ts option='{ "allowArray": true }' showPlaygroundButton
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
3
|
-
"version": "8.2.1-alpha.
|
3
|
+
"version": "8.2.1-alpha.15",
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -60,10 +60,10 @@
|
|
60
60
|
},
|
61
61
|
"dependencies": {
|
62
62
|
"@eslint-community/regexpp": "^4.10.0",
|
63
|
-
"@typescript-eslint/scope-manager": "8.2.1-alpha.
|
64
|
-
"@typescript-eslint/type-utils": "8.2.1-alpha.
|
65
|
-
"@typescript-eslint/utils": "8.2.1-alpha.
|
66
|
-
"@typescript-eslint/visitor-keys": "8.2.1-alpha.
|
63
|
+
"@typescript-eslint/scope-manager": "8.2.1-alpha.15",
|
64
|
+
"@typescript-eslint/type-utils": "8.2.1-alpha.15",
|
65
|
+
"@typescript-eslint/utils": "8.2.1-alpha.15",
|
66
|
+
"@typescript-eslint/visitor-keys": "8.2.1-alpha.15",
|
67
67
|
"graphemer": "^1.4.0",
|
68
68
|
"ignore": "^5.3.1",
|
69
69
|
"natural-compare": "^1.4.0",
|
@@ -74,8 +74,8 @@
|
|
74
74
|
"@types/marked": "^5.0.2",
|
75
75
|
"@types/mdast": "^4.0.3",
|
76
76
|
"@types/natural-compare": "*",
|
77
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.2.1-alpha.
|
78
|
-
"@typescript-eslint/rule-tester": "8.2.1-alpha.
|
77
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.2.1-alpha.15",
|
78
|
+
"@typescript-eslint/rule-tester": "8.2.1-alpha.15",
|
79
79
|
"ajv": "^6.12.6",
|
80
80
|
"cross-env": "^7.0.3",
|
81
81
|
"cross-fetch": "*",
|