gpt4 book ai didi

ecmascript-6 - 导入的 ESLint 规则错误

转载 作者:行者123 更新时间:2023-12-01 08:10:47 27 4
gpt4 key购买 nike

我通过 eslint 收到以下错误。

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

enter image description here

最佳答案

因为您收到了这条消息,看起来您已经升级到 ESLint 2.0,这太棒了!我可以看到您将对配置进行的两项更改,但如果出现其他任何问题,它可能包含在 2.0 migration guide 中。 :

  1. 在 2.0 中,"ecmaFeatures": { "modules": true } 已变为 "parserOptions": { "sourceType": "module"}
  2. 我们替换了space-after-keywords使用新规则,keyword-spacing ,它是在 2.0 测试版之一中引入的。如果您使用的是 "space-after-keywords: 2,您现在可以将其更改为 "keyword-spacing": 2

综上所述,ESLint 2.0 的 .eslintrc 应该包括如下内容:

{
"parserOptions": {
"sourceType": "module"
},
"env": {
"es6": true
},
"rules": {
"keyword-spacing": 2
}
}

关于ecmascript-6 - 导入的 ESLint 规则错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35834879/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com