【问题标题】:SublimeLinter ignore missing semicolonsSublimeLinter 忽略缺少的分号
【发布时间】:2015-09-22 08:13:12
【问题描述】:

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

我尝试将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"]
    },

【问题讨论】:

  • 有人回复然后删除了帖子,但它是正确的。查看修改

标签: sublimetext3 jslint sublimelinter


【解决方案1】:

完整答案,

Full user settings json file:


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

【讨论】:

    【解决方案2】:

    简单回答:

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

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

    【讨论】:

    • 在哪里添加它。到 sublime-linter 设置或 jshint 设置? (我没找到)?
    猜你喜欢
    • 2012-04-21
    • 2013-11-15
    • 2021-05-23
    • 2012-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-19
    • 2015-04-14
    相关资源
    最近更新 更多