跳到主要内容

@typescript-eslint/typedef

在某些位置需要类型注释。

支持检查的范围从选项中查看。

规则配置

// code-linter.json5
{
"rules": {
"@typescript-eslint/typedef": "error"
}
}

选项

详情请参考@typescript-eslint/typedef选项

正例

export const text = 'text';

反例

// 默认配置下,规则不会告警

规则集

plugin:@typescript-eslint/all

Code Linter代码检查规则的配置指导请参考Code Linter代码检查