它可能不起作用,因为 ESLint 的版本与标准配置不匹配



我运行了命令npx eslint --init。我遇到了以下问题:

? Which style guide do you want to follow? … 
Airbnb: https://github.com/airbnb/javascript
▸ Standard: https://github.com/standard/standard
Google: https://github.com/google/eslint-config-google
XO: https://github.com/xojs/eslint-config-xo

我选择了Standard。然后它说:

✔ The style guide "standard" requires eslint@^7.12.1. You are currently using eslint@8.10.0.
Do you want to downgrade? · No / Yes

我选择了No

然后我说:

Note: it might not work since ESLint's version is mismatched with the standard config.

理想情况下我应该降级吗?或者我不应该完全使用标准样式指南?

查看repo,eslint-config-standard@17.x.y默认情况下与eslint 8.8.0配合使用(尽管它仍然是预发行版(。

我假设您仍然收到16.x版本,默认为eslint@7.18.0

运行npx eslint --init可以为您提供eslint-config-standard的确切版本?

如果您正在将其用于新项目,我建议您使用eslint-config-standard@next。该项目得到了非常积极的维护,他们目前的主要关注点是将一切提升到ESLint8.x,所以等待时间不会太长。

最新更新