Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[@typescript-eslint/ban-types] Function is not banned by default #1896

Closed
Labels
duplicateThis issue or pull request already existspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@snebjorn

Description

@snebjorn

Repro

{"rules": {"@typescript-eslint/ban-types": ["error"]  }}
functionisFunction(value:any):value isFunction{returntypeofvalue==='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

packageversion
@typescript-eslint/eslint-plugin2.27.0
@typescript-eslint/parser2.27.0
TypeScript3.8.3
ESLint6.8.0
node13.12.0
npmX.Y.Z
yarn1.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp