导入的ESLint规则错误

ano*_*oop 1 ecmascript-6 eslint atom-editor

我通过eslint得到以下错误.

我也在文件中添加ecmaFeatures: { "modules": true }了.eslintrc.

在此输入图像描述

btm*_*lls 7

因为您收到了这条消息,看起来您已升级到ESLint 2.0,这太棒了!我可以看到您将对配置进行两项更改,但如果出现其他任何更改,则可能会在2.0迁移指南中介绍:

  1. 在2.0中,"ecmaFeatures": { "modules": true }已经成为"parserOptions": { "sourceType": "module" }.
  2. 我们更换空后的关键字有新的规则,关键字间隔,这是在2.0测试版的一个介绍.如果您正在使用"space-after-keywords: 2,则可以将其更改为"keyword-spacing": 2现在.

.eslintrc把这一切放在一起,你的ESLint 2.0应该包括这样的东西:

{
    "parserOptions": {
        "sourceType": "module"
    },
    "env": {
        "es6": true
    },
    "rules": {
        "keyword-spacing": 2
    }
}
Run Code Online (Sandbox Code Playgroud)