文档管理中心
指南编写与调试应用代码编辑代码检查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代码检查

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