gpt4 book ai didi

jshint - 在 WebStorm IDE 中配置 *all* JSHint 设置

转载 作者:行者123 更新时间:2023-12-04 23:59:29 28 4
gpt4 key购买 nike

在对用于前端开发的 IDE 进行了一些综合评估后,我认为 WebStorm 领先。

缺少的一点是我们无法按照我们需要的方式配置 JSHint。 WebStorm 首选项 GUI 提供了一些选项,但不是全套。 GUI 只允许您配置 30 个左右的实际可用选项中的 15 个。

这是一个问题,因为我们不想仅仅因为 IDE 不允许我们按照我们想要的方式配置 linting 就改变我们的编码实践。

是否有一种hacky 方法可以在WebStorm 的幕后调整JSHint 库?

最佳答案

您可以在 .jshintrc 中配置您想要的所有选项文件位于项目的根目录中。这将是一个项目范围的设置。
来自 https://www.jetbrains.com/webstorm/webhelp/jshint.html :

Use config files

Select this check box to have the code verified according to the settings from a configuration file. A configuration file is a JSON file with the extension .jshintrc that specifies which JSHint options should be enabled or disabled. WebStorm will look for a .jshintrc file in the working directory. If the search fails, WebStorm will search in the parent folder, then again in the parent folder. The process is repeated until WebStorm finds a .jshintrc or reaches the project root. To have WebStorm still run verification in this case, specify the default configuration file to use.


我已经用了一段时间了,效果很好。此外,您可以将其提交到您的存储库并确保整个团队遵循相同的代码风格。也是添加全局变量的好地方。

关于jshint - 在 WebStorm IDE 中配置 *all* JSHint 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12372736/

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