naming-convention
强制对代码库中的所有内容进行命名约定.
该规则需要 类型信息 才能运行,但这会带来性能方面的权衡。
强制命名约定有助于保持代码库的一致性,并减少考虑如何命名变量时的开销。此外,精心设计的样式指南可以帮助传达意图,例如强制所有私有属性以 _
开头,并且所有全局级常量都用 UPPER_CASE
编写。
¥Enforcing naming conventions helps keep the codebase consistent, and reduces overhead when thinking about how to name a variable.
Additionally, a well-designed style guide can help communicate intent, such as by enforcing all private properties begin with an _
, and all global-level constants are written in UPPER_CASE
.
此规则功能已冻结: ==== 此规则由 TypeScript 类型提供支持,因此,如果类型与运行时行为不匹配,则规则可能会报告不准确。它将不再接收新功能,例如新选项。它仍将接受针对其现有功能字段的错误和文档修复,并支持新的 TypeScript 版本。
¥This rule is feature frozen: it will no longer receive new features such as new options. It still will accept bug and documentation fixes for its existing area of features and to support new TypeScript versions.
随着请求的功能越来越模糊,强制命名和/或排序约定的样式规则往往会变得难以理解的复杂。此规则已达到 typescript-eslint 项目维护的合理极限。有关更多信息,请参阅 eslint-plugin:功能冻结命名和排序样式规则。
¥Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested. This rule has reached the limit of what is reasonable for the typescript-eslint project to maintain. See eslint-plugin: Feature freeze naming and sorting stylistic rules for more information.
- 扁平配置
- 旧版配置
export default tseslint.config({
rules: {
"@typescript-eslint/naming-convention": "error"
}
});
module.exports = {
"rules": {
"@typescript-eslint/naming-convention": "error"
}
};
在线运行试试这个规则 ↗
示例
¥Examples
此规则允许你对任何标识符强制执行约定,使用细粒度选择器来创建细粒度的样式指南。
¥This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide.
此规则谨慎行事,仅适用于底部类型、顶部类型以及将字面量类型与原始类型进行比较。
¥This rule only needs type information in specific cases, detailed below.
选项
¥Options
该规则接受对象数组,每个对象描述不同的命名约定。下面将详细描述每个属性。另请参阅下面的示例部分以获取图示示例。
¥This rule accepts an array of objects, with each object describing a different naming convention. Each property will be described in detail below. Also see the examples section below for illustrated examples.
type Options = {
// format options
format:
| (
| 'camelCase'
| 'strictCamelCase'
| 'PascalCase'
| 'StrictPascalCase'
| 'snake_case'
| 'UPPER_CASE'
)[]
| null;
custom?: {
regex: string;
match: boolean;
};
leadingUnderscore?:
| 'forbid'
| 'require'
| 'requireDouble'
| 'allow'
| 'allowDouble'
| 'allowSingleOrDouble';
trailingUnderscore?:
| 'forbid'
| 'require'
| 'requireDouble'
| 'allow'
| 'allowDouble'
| 'allowSingleOrDouble';
prefix?: string[];
suffix?: string[];
// selector options
selector: Selector | Selector[];
filter?:
| string
| {
regex: string;
match: boolean;
};
// the allowed values for these are dependent on the selector - see below
modifiers?: Modifiers<Selector>[];
types?: Types<Selector>[];
}[];
// the default config is similar to ESLint's camelcase rule but more strict
const defaultOptions: Options = [
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
];
格式选项
¥Format Options
每个选择器都可以具有相同的格式选项集。有关如何应用每个选择器的信息,请参阅 "该规则如何评估名称的格式?"。
¥Every single selector can have the same set of format options. For information about how each selector is applied, see "How does the rule evaluate a name's format?".
format
format
选项定义标识符的允许格式。此选项接受以下值的数组,并且标识符可以与其中任何一个匹配:
¥The format
option defines the allowed formats for the identifier. This option accepts an array of the following values, and the identifier can match any of them:
-
camelCase
- 标准 camelCase 格式 - 字符之间不允许有下划线,允许连续大写(即myID
和myId
均有效)。¥
camelCase
- standard camelCase format - no underscores are allowed between characters, and consecutive capitals are allowed (i.e. bothmyID
andmyId
are valid). -
PascalCase
- 与camelCase
相同,但第一个字符必须大写。¥
PascalCase
- same ascamelCase
, except the first character must be upper-case. -
snake_case
- 标准 snake_case 格式 - 所有字符都必须是小写,并且允许使用下划线。¥
snake_case
- standard snake_case format - all characters must be lower-case, and underscores are allowed. -
strictCamelCase
- 与camelCase
相同,但不允许连续大写(即myId
有效,但myID
无效)。¥
strictCamelCase
- same ascamelCase
, but consecutive capitals are not allowed (i.e.myId
is valid, butmyID
is not). -
StrictPascalCase
- 与strictCamelCase
相同,但第一个字符必须大写。¥
StrictPascalCase
- same asstrictCamelCase
, except the first character must be upper-case. -
UPPER_CASE
- 与snake_case
相同,但所有字符都必须大写。¥
UPPER_CASE
- same assnake_case
, except all characters must be upper-case.
除了数组,你还可以传递 null
。这表示 "此选择器不应 检查其格式"。如果你想在应用组选择器后对特定选择器不强制执行特定格式,这会很有用。
¥Instead of an array, you may also pass null
. This signifies "this selector shall not have its format checked".
This can be useful if you want to enforce no particular format for a specific selector, after applying a group selector.
custom
custom
选项定义标识符必须(或不能)匹配的自定义正则表达式。此选项允许你对标识符进行更细粒度的控制,从而禁止(或强制)某些模式和子字符串。接受具有以下属性的对象:
¥The custom
option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings.
Accepts an object with the following properties:
-
match
- 如果标识符必须与regex
匹配,则为 true,如果标识符不能与regex
匹配,则为 false。¥
match
- true if the identifier must match theregex
, false if the identifier must not match theregex
. -
regex
- 然后传递到 RegExp 中以创建新正则表达式的字符串:new RegExp(regex)
¥
regex
- a string that is then passed into RegExp to create a new regular expression:new RegExp(regex)
filter
filter
选项的操作 类似于 custom
,接受相同形状的对象,不同之处在于它控制是否应将其余配置应用于标识符。
¥The filter
option operates similar to custom
, accepting the same shaped object, except that it controls if the rest of the configuration should or should not be applied to an identifier.
你可以使用它来包含或排除特定配置中的特定标识符。
¥You can use this to include or exclude specific identifiers from specific configurations.
接受具有以下属性的对象:
¥Accepts an object with the following properties:
-
match
- 如果标识符必须与regex
匹配,则为 true,如果标识符不能与regex
匹配,则为 false。¥
match
- true if the identifier must match theregex
, false if the identifier must not match theregex
. -
regex
- 然后传递到 RegExp 中以创建新正则表达式的字符串:new RegExp(regex)
¥
regex
- a string that is then passed into RegExp to create a new regular expression:new RegExp(regex)
或者,filter
接受正则表达式(new RegExp(filter)
中接受的任何内容)。在这种情况下,它会被视为你已经传递了一个带有正则表达式和 match: true
的对象。
¥Alternatively, filter
accepts a regular expression (anything accepted into new RegExp(filter)
). In this case, it's treated as if you had passed an object with the regex and match: true
.
leadingUnderscore
/trailingUnderscore
leadingUnderscore
/ trailingUnderscore
选项控制前导/尾随下划线是否被视为有效。接受以下值之一:
¥The leadingUnderscore
/ trailingUnderscore
options control whether leading/trailing underscores are considered valid. Accepts one of the following values:
-
allow
- 没有明确强制要求存在单个前导/尾随下划线。¥
allow
- existence of a single leading/trailing underscore is not explicitly enforced. -
allowDouble
- 没有明确强制要求存在双前导/尾随下划线。¥
allowDouble
- existence of a double leading/trailing underscore is not explicitly enforced. -
allowSingleOrDouble
- 没有明确强制要求存在单个或双前导/尾随下划线。¥
allowSingleOrDouble
- existence of a single or a double leading/trailing underscore is not explicitly enforced. -
forbid
- 完全不允许使用前导/尾随下划线。¥
forbid
- a leading/trailing underscore is not allowed at all. -
require
- 必须包含单个前导/尾随下划线。¥
require
- a single leading/trailing underscore must be included. -
requireDouble
- 必须包含两个前导/尾随下划线。¥
requireDouble
- two leading/trailing underscores must be included.
prefix
/suffix
prefix
/ suffix
选项控制标识符必须存在哪些前缀/后缀字符串。接受字符串数组。
¥The prefix
/ suffix
options control which prefix/suffix strings must exist for the identifier. Accepts an array of strings.
如果提供了这些,则标识符必须以提供的值之一开头。例如,如果你提供 { prefix: ['Class', 'IFace', 'Type'] }
,则以下名称有效:ClassBar
、IFaceFoo
、TypeBaz
,但名称 Bang
无效,因为它不包含任何前缀。
¥If these are provided, the identifier must start with one of the provided values. For example, if you provide { prefix: ['Class', 'IFace', 'Type'] }
, then the following names are valid: ClassBar
, IFaceFoo
, TypeBaz
, but the name Bang
is not valid, as it contains none of the prefixes.
注意:与 上面记录了 一样,前缀在验证格式之前被修剪,因此必须使用 PascalCase 来允许使用前缀 is
的变量(例如 isEnabled
)。
¥Note: As documented above, the prefix is trimmed before format is validated, therefore PascalCase must be used to allow variables such as isEnabled
using the prefix is
.
选择器选项
¥Selector Options
-
selector
允许你指定要定位的标识符类型。¥
selector
allows you to specify what types of identifiers to target.-
接受一个或一组选择器来定义适用于一个或多个选择器的选项块。
¥Accepts one or array of selectors to define an option block that applies to one or multiple selectors.
-
例如,如果你提供
{ selector: ['function', 'variable'] }
,则它将对变量和函数节点应用相同的选项。¥For example, if you provide
{ selector: ['function', 'variable'] }
, then it will apply the same option to variable and function nodes. -
有关允许的选择器的完整列表,请参阅下面的 允许的选择器、修饰符和类型。
¥See Allowed Selectors, Modifiers and Types below for the complete list of allowed selectors.
-
-
modifiers
允许你指定要精细应用的修饰符,例如可访问性(#private
/private
/protected
/public
),或者该事物是否为static
等。¥
modifiers
allows you to specify which modifiers to granularly apply to, such as the accessibility (#private
/private
/protected
/public
), or if the thing isstatic
, etc.-
该名称必须与所有修饰符匹配。
¥The name must match all of the modifiers.
-
例如,如果你提供
{ modifiers: ['private','readonly','static'] }
,则它只会匹配private static readonly
,而private
则不会匹配。¥For example, if you provide
{ modifiers: ['private','readonly','static'] }
, then it will only match something that isprivate static readonly
, and something that is justprivate
will not match. -
允许以下
modifiers
:¥The following
modifiers
are allowed:-
abstract
,override
,private
,protected
,readonly
,static
- 匹配任何使用给定修饰符明确声明的成员。¥
abstract
,override
,private
,protected
,readonly
,static
- matches any member explicitly declared with the given modifier. -
async
- 匹配任何通过async
关键字异步的方法、函数或函数变量(例如,不匹配不使用async
关键字返回 promise 的函数)¥
async
- matches any method, function, or function variable which is async via theasync
keyword (e.g. does not match functions that return promises without usingasync
keyword) -
const
- 匹配声明为const
(const x = 1
) 的变量。¥
const
- matches a variable declared as beingconst
(const x = 1
). -
destructured
- 匹配通过对象解构模式声明的变量 (const {x, z = 2}
)。¥
destructured
- matches a variable declared via an object destructuring pattern (const {x, z = 2}
).-
请注意,这与重命名的解构属性 (
const {x: y, a: b = 2}
) 不匹配。¥Note that this does not match renamed destructured properties (
const {x: y, a: b = 2}
).
-
-
exported
- 匹配从模块导出的任何内容。¥
exported
- matches anything that is exported from the module. -
global
- 匹配在顶层范围内声明的变量/函数。¥
global
- matches a variable/function declared in the top-level scope. -
#private
- 匹配任何具有私有标识符(以#
开头的标识符)的成员¥
#private
- matches any member with a private identifier (an identifier that starts with#
) -
public
- 匹配任何明确声明为public
或没有可见性修饰符(即隐式公开)的成员。¥
public
- matches any member that is either explicitly declared aspublic
, or has no visibility modifier (i.e. implicitly public). -
requiresQuotes
- 匹配任何需要引号的名称,因为它不是有效标识符(即其中包含空格、破折号等)。¥
requiresQuotes
- matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it). -
unused
- 匹配任何未使用的内容。¥
unused
- matches anything that is not used.
-
-
-
types
允许你指定要匹配的类型。此选项仅支持简单、原始类型(array
、boolean
、function
、number
、string
)。¥
types
allows you to specify which types to match. This option supports simple, primitive types only (array
,boolean
,function
,number
,string
).-
该名称必须与其中一种类型匹配。
¥The name must match one of the types.
-
注意 - 使用此选项将需要你使用类型信息进行 lint。
¥NOTE - Using this option will require that you lint with type information.
-
例如,这允许你执行诸如强制
boolean
变量以动词为前缀的操作。¥For example, this lets you do things like enforce that
boolean
variables are prefixed with a verb. -
允许以下
types
:¥The following
types
are allowed:-
array
匹配任何可分配给Array<unknown> | null | undefined
的类型¥
array
matches any type assignable toArray<unknown> | null | undefined
-
boolean
匹配任何可分配给boolean | null | undefined
的类型¥
boolean
matches any type assignable toboolean | null | undefined
-
function
匹配任何可分配给Function | null | undefined
的类型¥
function
matches any type assignable toFunction | null | undefined
-
number
匹配任何可分配给number | null | undefined
的类型¥
number
matches any type assignable tonumber | null | undefined
-
string
匹配任何可分配给string | null | undefined
的类型¥
string
matches any type assignable tostring | null | undefined
-
-
选择器的顺序并不重要。该实现将自动对选择器进行排序,以确保它们从最具体到最不具体的匹配。它将继续按该顺序检查选择器,直到找到与名称匹配的选择器。参见 "规则如何自动对选择器进行排序?"
¥The ordering of selectors does not matter. The implementation will automatically sort the selectors to ensure they match from most-specific to least specific. It will keep checking selectors in that order until it finds one that matches the name. See "How does the rule automatically order selectors?"
允许的选择器、修饰符和类型
¥Allowed Selectors, Modifiers and Types
选择器有两种类型:单独选择器和分组选择器。
¥There are two types of selectors, individual selectors, and grouped selectors.
单独选择器
¥Individual Selectors
各个选择器匹配特定的、定义明确的集合。每个单独的选择器之间没有重叠。
¥Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors.
-
classicAccessor
- 匹配任何访问器。它指的是附加到get
和set
语法的方法。¥
classicAccessor
- matches any accessor. It refers to the methods attached toget
andset
syntax.-
允许的
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
autoAccessor
- 匹配任何自动访问器。自动访问器只是一个以accessor
关键字开头的类字段。¥
autoAccessor
- matches any auto-accessor. An auto-accessor is just a class field starting with anaccessor
keyword.-
允许的
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
class
- 匹配任何类声明。¥
class
- matches any class declaration.-
允许的
modifiers
:abstract
,exported
,unused
.¥Allowed
modifiers
:abstract
,exported
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
classMethod
- 匹配任何类方法。还匹配具有直接函数表达式或箭头函数表达式值的属性。与访问器不匹配。¥
classMethod
- matches any class method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.-
允许的
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,requiresQuotes
,static
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
classProperty
- 匹配任何类属性。不匹配具有直接函数表达式或箭头函数表达式值的属性。¥
classProperty
- matches any class property. Does not match properties that have direct function expression or arrow function expression values.-
允许的
modifiers
:abstract
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
enum
- 匹配任何枚举声明。¥
enum
- matches any enum declaration.-
允许的
modifiers
:exported
,unused
.¥Allowed
modifiers
:exported
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
enumMember
- 匹配任何枚举成员。¥
enumMember
- matches any enum member.-
允许的
modifiers
:requiresQuotes
。¥Allowed
modifiers
:requiresQuotes
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
function
- 匹配任何命名函数声明或命名函数表达式。¥
function
- matches any named function declaration or named function expression.-
允许的
modifiers
:async
,exported
,global
,unused
.¥Allowed
modifiers
:async
,exported
,global
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
import
- 匹配命名空间导入和默认导入(即不匹配命名导入)。¥
import
- matches namespace imports and default imports (i.e. does not match named imports).-
允许的
modifiers
:default
,namespace
.¥Allowed
modifiers
:default
,namespace
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
interface
- 匹配任何接口声明。¥
interface
- matches any interface declaration.-
允许的
modifiers
:exported
,unused
.¥Allowed
modifiers
:exported
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
objectLiteralMethod
- 匹配任何对象字面量方法。还匹配具有直接函数表达式或箭头函数表达式值的属性。与访问器不匹配。¥
objectLiteralMethod
- matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.-
允许的
modifiers
:async
,public
,requiresQuotes
.¥Allowed
modifiers
:async
,public
,requiresQuotes
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
objectLiteralProperty
- 匹配任何对象字面量属性。不匹配具有直接函数表达式或箭头函数表达式值的属性。¥
objectLiteralProperty
- matches any object literal property. Does not match properties that have direct function expression or arrow function expression values.-
允许的
modifiers
:public
,requiresQuotes
.¥Allowed
modifiers
:public
,requiresQuotes
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
parameter
- 匹配任何函数参数。与参数属性不匹配。¥
parameter
- matches any function parameter. Does not match parameter properties.-
允许的
modifiers
:destructured
,unused
.¥Allowed
modifiers
:destructured
,unused
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
parameterProperty
- 匹配任何参数属性。¥
parameterProperty
- matches any parameter property.-
允许的
modifiers
:private
,protected
,public
,readonly
.¥Allowed
modifiers
:private
,protected
,public
,readonly
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
typeAlias
- 匹配任何类型别名声明。¥
typeAlias
- matches any type alias declaration.-
允许的
modifiers
:exported
,unused
.¥Allowed
modifiers
:exported
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
typeMethod
- 匹配任何对象类型方法。还匹配具有直接函数表达式或箭头函数表达式值的属性。与访问器不匹配。¥
typeMethod
- matches any object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.-
允许的
modifiers
:public
,requiresQuotes
.¥Allowed
modifiers
:public
,requiresQuotes
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
typeParameter
- 匹配任何泛型类型参数声明。¥
typeParameter
- matches any generic type parameter declaration.-
允许的
modifiers
:unused
。¥Allowed
modifiers
:unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
typeProperty
- 匹配任何对象类型属性。不匹配具有直接函数表达式或箭头函数表达式值的属性。¥
typeProperty
- matches any object type property. Does not match properties that have direct function expression or arrow function expression values.-
允许的
modifiers
:public
,readonly
,requiresQuotes
.¥Allowed
modifiers
:public
,readonly
,requiresQuotes
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
variable
- 匹配任何const
/let
/var
变量名。¥
variable
- matches anyconst
/let
/var
variable name.-
允许的
modifiers
:async
,const
,destructured
,exported
,global
,unused
.¥Allowed
modifiers
:async
,const
,destructured
,exported
,global
,unused
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
组选择器
¥Group Selectors
组选择器是为了方便起见而提供的,本质上是将各个选择器的集合打包在一起。
¥Group Selectors are provided for convenience, and essentially bundle up sets of individual selectors.
-
default
- 匹配所有内容。¥
default
- matches everything.-
允许的
modifiers
:所有修饰符。¥Allowed
modifiers
: all modifiers. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
accessor
- 与classicAccessor
和autoAccessor
匹配相同。¥
accessor
- matches the same asclassicAccessor
andautoAccessor
.-
允许的
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,override
,private
,protected
,public
,requiresQuotes
,static
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
memberLike
- 与classicAccessor
、autoAccessor
、enumMember
、method
、parameterProperty
、property
匹配相同。¥
memberLike
- matches the same asclassicAccessor
,autoAccessor
,enumMember
,method
,parameterProperty
,property
.-
允许的
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
method
- 与classMethod
、objectLiteralMethod
、typeMethod
匹配相同。¥
method
- matches the same asclassMethod
,objectLiteralMethod
,typeMethod
.-
允许的
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
property
- 与classProperty
、objectLiteralProperty
、typeProperty
匹配相同。¥
property
- matches the same asclassProperty
,objectLiteralProperty
,typeProperty
.-
允许的
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
.¥Allowed
modifiers
:abstract
,async
,override
,#private
,private
,protected
,public
,readonly
,requiresQuotes
,static
. -
允许的
types
:array
,boolean
,function
,number
,string
.¥Allowed
types
:array
,boolean
,function
,number
,string
.
-
-
typeLike
- 与class
、enum
、interface
、typeAlias
、typeParameter
匹配相同。¥
typeLike
- matches the same asclass
,enum
,interface
,typeAlias
,typeParameter
.-
允许的
modifiers
:abstract
,unused
.¥Allowed
modifiers
:abstract
,unused
. -
允许的
types
:没有任何。¥Allowed
types
: none.
-
-
variableLike
- 与function
、parameter
和variable
匹配相同。¥
variableLike
- matches the same asfunction
,parameter
andvariable
.-
允许的
modifiers
:async
,unused
.¥Allowed
modifiers
:async
,unused
. -
允许的
types
-