前端技术之eslint初夜

  • Qin Yang
  • 3 Minutes
  • November 3, 2015

配置ESLint:

  1. Configuration Comments - use JavaScript comments to embed configuration information directly into a file
  2. Configuration Files

几个可配置的参数

定义js语言特性(ES5/ES6)

ecmaFeatures属性里,定义相应的js特性

示例代码:

1
2
3
4
5
6
7
8
9
10
{
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
"jsx": true
},
"rules": {
"semi": 2
}
}

Specifying Parser