【问题标题】:How to disbale 'use strict' for jshint in Atom如何在 Atom 中为 jshint 禁用“使用严格”
【发布时间】:2017-02-20 08:32:54
【问题描述】:

我想禁用 JSHint 警告 "W097": use function form of 'use strict'。

我知道我可以放置/* jshint -W097 */ 和/* jshint node: true */

但我不想在每个页面的顶部手动添加它。有没有办法从源代码或设置中禁用?

非常感谢

【问题讨论】:

标签: javascript atom-editor jshint use-strict


【解决方案1】:

您可以为您的项目甚至整个 atom 安装定义一个 .jshintrc 文件。假设您安装了 jshint,您可以参考“包含的功能”主题下的 this article

【讨论】:

  • 我试过用 jshintrc 文件来做这件事,但从来没有成功过。但我会看一下 README,谢谢
  • 我尝试同时添加 /* jshint -W097 / 和 / jshint node: true */ 但也许这不是正确的命令
【解决方案2】:

我基本上只是复制并粘贴了在我本地项目的 jshint 文件中找到的所有选项 here。从那里我将 false 设置为 strict 并将 true 设置为 esnext

【讨论】:

    猜你喜欢
    • 2016-10-24
    • 2017-07-09
    • 2013-11-23
    • 2011-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    • 2015-03-05
    相关资源
    最近更新 更多