文档管理中心
您当前浏览的HarmonyOS 5.0.1(API 13)文档归档不再维护,推荐您使用最新版本。详细请参考文档维护策略变更
指南DevEco Studio附录Code Linter代码检查规则通用规则@typescript-eslint@typescript-eslint/semi

@typescript-eslint/semi

要求或不允许使用分号。

规则配置

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

选项

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

正例

export const name = 'ESLint';

export class Foo {
  public bar = '1';
}

反例

// 默认在语句末尾需要加分号
export const name = 'ESLint'

export class Foo {
  // 默认在语句末尾需要加分号
  public bar = '1'
}

规则集

plugin:@typescript-eslint/all

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

在 指南 中进行搜索
请输入您想要搜索的关键词