【问题标题】:ESLint - Angular2 AnotationsESLint - Angular 2 注释
【发布时间】:2017-03-24 18:49:27
【问题描述】:

我使用 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 {

} 

【问题讨论】:

    标签: javascript angular gulp eslint


    【解决方案1】:

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

    plugins:
        - angular
    
    rules:
        # Whichever rules you like
    
    globals:
        angular: true
    
    settings:
        angular: 2
    

    【讨论】:

      猜你喜欢
      • 2017-04-14
      • 2016-04-29
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 2016-09-19
      • 1970-01-01
      • 2011-05-28
      相关资源
      最近更新 更多