ESLint - Angular 2 注释

ESLint - Angular2 Anotations

我使用 ESLintgulp-eslint。有没有办法为 Angular2 注释激活 linter 规则?

@Component( {
  selector: 'example',
  styleUrls: ['app.css'],
  templateUrl: 'app.html', //Linter should warn cause the semicolon
})
//Linter should warn in case of a blank line between componente and class

export class App {

} 

您可以使用 eslint-plugin-angular 获取 ESLint 的 Angular 特定规则。从那里,如果您想要尚不存在的特定规则,您可以了解如何将它们添加到插件中。

plugins:
    - angular

rules:
    # Whichever rules you like

globals:
    angular: true

settings:
    angular: 2