ban-types
旧的 ban-types 规则涵盖了多个功能字段,因此被分成了几个规则。
¥The old ban-types rule encompassed multiple areas of functionality, and so has been split into several rules.
no-restricted-types 是禁止可配置类型名称列表的新规则。默认情况下,它没有启用任何选项,类似于 no-restricted-globals、no-restricted-properties 和 no-restricted-syntax 等规则。
¥no-restricted-types is the new rule for banning a configurable list of type names.
It has no options enabled by default and is akin to rules like no-restricted-globals, no-restricted-properties, and no-restricted-syntax.
ban-types 中的默认选项现在涵盖:
¥The default options from ban-types are now covered by:
-
no-empty-object-type:在令人困惑的位置禁止内置{}类型¥
no-empty-object-type: banning the built-in{}type in confusing locations -
no-unsafe-function-type:禁止内置Function¥
no-unsafe-function-type: banning the built-inFunction -
no-wrapper-object-types:禁止Object和内置类封装器(如Number)¥
no-wrapper-object-types: banningObjectand built-in class wrappers such asNumber
ban-types 本身在 typescript-eslint v8 中被删除。请参阅 宣布 typescript-eslint v8 Beta 以了解更多详细信息。
¥ban-types itself is removed in typescript-eslint v8.
See Announcing typescript-eslint v8 Beta for more details.