[英]ESLint rule error for import
Because you're getting that message, it looks like you've upgraded to ESLint 2.0, which is great! 因为您收到该消息,所以看来您已升级到ESLint 2.0,这太好了! I can see two changes that you'll make to your configuration, though if anything else comes up, it's probably covered under the 2.0 migration guide :
我可以看到您将对配置进行两项更改,但是如果有其他问题,可能会在《 2.0迁移指南》中进行介绍 :
"ecmaFeatures": { "modules": true }
has become "parserOptions": { "sourceType": "module" }
. "ecmaFeatures": { "modules": true }
已成为"parserOptions": { "sourceType": "module" }
。 "space-after-keywords: 2
, you can change that to "keyword-spacing": 2
now. "space-after-keywords: 2
,则可以立即将其更改为"keyword-spacing": 2
。 Putting that all together, your .eslintrc
for ESLint 2.0 should include something like this: .eslintrc
,ESLint 2.0的.eslintrc应该包括以下内容:
{
"parserOptions": {
"sourceType": "module"
},
"env": {
"es6": true
},
"rules": {
"keyword-spacing": 2
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.