Closed
Description
Repro
{
"rules": {
"@typescript-eslint/ban-types": ["error"]
}
}
function isFunction(value: any): value is Function {
return typeof value === 'function';
}
Expected Result
The tslint:recommended ruleset for ban-types includes Function
https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts#L23
So I would expect it to be the same in @typescript-eslint/recommended.
I was unable to find any issues about it being intentionally removed.
Actual Result
Function type usage is not banned
Additional Info
To match TSLint I have to do this
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Function": {
"message": "Prefer a specific function type, like `() => void`."
}
}
}
]
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.27.0 |
@typescript-eslint/parser |
2.27.0 |
TypeScript |
3.8.3 |
ESLint |
6.8.0 |
node |
13.12.0 |
npm |
X.Y.Z |
yarn |
1.22.0 |