SublimeLinter忽略缺少的分号

时间:2015-07-04 19:44:42

标签: sublimetext3 jslint sublimelinter

我在我的一个节点应用程序中使用了基于非分号的编码样式,但问题是SublimeLinter正在记录所有丢失的分号,并最终因“#34;太多错误而停止”#34;错误,并停止linting脚本的其余部分。

我已尝试在默认设置和用户设置中添加ignore_match对象,但无效。我每次尝试确定之后都会重新启动。

我甚至尝试将其添加到设置的excludes部分。

这是我使用的资源: Linter Settings

以下是我遇到的错误之一:

Z:\www\site\node\workers.js: line 162, col 2, Missing semicolon. (W033)

这是我的设置:来自用户。

{
    "user": {
        "debug": true,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "ignore_match": [
            "Missing semicolon."
        ],
        "lint_mode": "background",
        "linters": {
            "annotations": {
                "@disable": false,
                "args": [],
                "errors": [
                    "FIXME"
                ],
                "excludes": ["Missing semicolon"],
                "warnings": [
                    "TODO",
                    "README"
                ]
            },
            "jshint": {
                "@disable": false,
                "args": [],
                "excludes": ["Missing semicolon"]
            },
            "php": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "outline",
        "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",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

编辑:

在jshint选项中添加了ignore_match": ["Missing semicolon"]。它变成了:

    "jshint": {
        "@disable": false,
        "args": [],
        "excludes": [],
        "ignore_match": ["Missing semicolon"]
    },

2 个答案:

答案 0 :(得分:8)

完整答案,

Full user settings json file:


{
    "user": {
        "linters": {
            "jshint": {
                "@disable": false,
                "ignore_match": [
                    ".*Missing.*",
                ]
            },
        }
    }
}

答案 1 :(得分:1)

简单回答:

ignore_match": ["Missing semicolon"]添加到jshint选项。

"jshint": {
        "@disable": false,
        "args": [],
        "excludes": [],
        "ignore_match": ["Missing semicolon"]
    },