ESLint - Angular2 Anotations

时间:2016-11-10 16:39:30

标签: javascript angular gulp eslint

我使用 ESLint gulp-eslint 。有没有办法激活Angular2 anotations的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 {

} 

1 个答案:

答案 0 :(得分:1)

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

plugins:
    - angular

rules:
    # Whichever rules you like

globals:
    angular: true

settings:
    angular: 2