如何添加' asi '选项到JSHint



我想禁用对缺少分号的警告。我该怎么办?

这是我的配置文件:

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Blueberry/cross/Blueberry - cross.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "linters": {
            "jshint": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "none",
        "no_column_highlights_line": false,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "javascript (babel)": "javascript",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true,
    }
}

我建议在您的项目中添加一个.jshintrc文件,您可以在其中添加所有设置,因为这是更好的实践,而不是全局更改您的设置(这样,其他人将能够通过使用相同的.jshintrc文件使用与您相同的过滤器设置)。


如果你仍然想改变你的全局设置,你可以创建一个文件与任何名称(.jshint.conf为例)。将jshint设置添加到该文件中。

示例.jshint.conf文件:

{
    "asi": true
}

把这个文件保存到某个地方(我建议把它放在你的Packages/User)。

现在,你可以更新你的sublime linter设置:

"linters": {
    "jshint": {
        "@disable": false,
        "args": [
            "--config", "c:\Use\Your\Path\To\jshint\settings\jshintrc.conf"
         ],
        "excludes": []
    }
}

更多关于升华elinter -jshint: https://github.com/SublimeLinter/SublimeLinter-jshint#settings

在未来,我建议查看README的插件,无论你想要配置什么。它们通常非常详细。该链接提供了全局设置jshint设置的确切说明。

最新更新