@typescript-eslint/eslint-plugin 6.8.1-alpha.13 → 6.8.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.
- package/docs/rules/ban-types.md +1 -57
- package/package.json +7 -7
package/docs/rules/ban-types.md
CHANGED
|
@@ -75,63 +75,7 @@ The default options provide a set of "best practices", intended to provide safet
|
|
|
75
75
|
<details>
|
|
76
76
|
<summary>Default Options</summary>
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
const defaultTypes = {
|
|
80
|
-
String: {
|
|
81
|
-
message: 'Use string instead',
|
|
82
|
-
fixWith: 'string',
|
|
83
|
-
},
|
|
84
|
-
Boolean: {
|
|
85
|
-
message: 'Use boolean instead',
|
|
86
|
-
fixWith: 'boolean',
|
|
87
|
-
},
|
|
88
|
-
Number: {
|
|
89
|
-
message: 'Use number instead',
|
|
90
|
-
fixWith: 'number',
|
|
91
|
-
},
|
|
92
|
-
Symbol: {
|
|
93
|
-
message: 'Use symbol instead',
|
|
94
|
-
fixWith: 'symbol',
|
|
95
|
-
},
|
|
96
|
-
BigInt: {
|
|
97
|
-
message: 'Use bigint instead',
|
|
98
|
-
fixWith: 'bigint',
|
|
99
|
-
},
|
|
100
|
-
Function: {
|
|
101
|
-
message: [
|
|
102
|
-
'The `Function` type accepts any function-like value.',
|
|
103
|
-
'It provides no type safety when calling the function, which can be a common source of bugs.',
|
|
104
|
-
'It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.',
|
|
105
|
-
'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
|
|
106
|
-
].join('\n'),
|
|
107
|
-
},
|
|
108
|
-
// object typing
|
|
109
|
-
Object: {
|
|
110
|
-
message: [
|
|
111
|
-
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
|
112
|
-
'- If you want a type meaning "any object", you probably want `object` instead.',
|
|
113
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
114
|
-
'- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.',
|
|
115
|
-
].join('\n'),
|
|
116
|
-
suggest: ['object', 'unknown', 'NonNullable<unknown>'],
|
|
117
|
-
},
|
|
118
|
-
'{}': {
|
|
119
|
-
message: [
|
|
120
|
-
'`{}` actually means "any non-nullish value".',
|
|
121
|
-
'- If you want a type meaning "any object", you probably want `object` instead.',
|
|
122
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
123
|
-
'- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.',
|
|
124
|
-
'- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.',
|
|
125
|
-
].join('\n'),
|
|
126
|
-
suggest: [
|
|
127
|
-
'object',
|
|
128
|
-
'unknown',
|
|
129
|
-
'Record<string, never>',
|
|
130
|
-
'NonNullable<unknown>',
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
```
|
|
78
|
+
<!-- Inject default options -->
|
|
135
79
|
|
|
136
80
|
</details>
|
|
137
81
|
|
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.15+76ab37392",
|
|
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.15+76ab37392",
|
|
61
|
+
"@typescript-eslint/type-utils": "6.8.1-alpha.15+76ab37392",
|
|
62
|
+
"@typescript-eslint/utils": "6.8.1-alpha.15+76ab37392",
|
|
63
|
+
"@typescript-eslint/visitor-keys": "6.8.1-alpha.15+76ab37392",
|
|
64
64
|
"debug": "^4.3.4",
|
|
65
65
|
"graphemer": "^1.4.0",
|
|
66
66
|
"ignore": "^5.2.4",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/marked": "*",
|
|
75
75
|
"@types/natural-compare": "*",
|
|
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.15+76ab37392",
|
|
78
78
|
"ajv": "^6.12.6",
|
|
79
79
|
"chalk": "^5.3.0",
|
|
80
80
|
"cross-fetch": "*",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"type": "opencollective",
|
|
104
104
|
"url": "https://opencollective.com/typescript-eslint"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "76ab37392311e4469a3865ceaf7ef5ad546523d8"
|
|
107
107
|
}
|