如何使用eslint抑制sublimelinter中的警告?

时间:2016-11-22 22:21:36

标签: sublimetext3 eslint suppress-warnings sublimelinter

我使用sublime作为我的IDE,并已下载sublimelinter用于使用eslint linting我的javascript。在sublimelinter.sublimesettings文件中,我将其配置为使用如下所示的eslint:

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "load/save",
        "linters": {
            "eslint": {
                "@disable": false,
                "args": [],
                "excludes": [],
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "passive_warnings": true,
        "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",
            "magicpython": "python",
            "php": "html",
            "python django": "python",
            "pythonimproved": "python"
        },
        "warning_color": "000000",
        "wrap_find": true
    }
}

我的问题是我无法在网上找到任何内容来抑制来自eslint的警告。我尝试使用"ignore": "W"作为eslint中的值,但它没有用。 Eslint工作正常,我似乎无法找到抑制警告的解决方案。有任何想法吗?

编辑: 这是我的.eslintrc文件:

{
  /* Don't search any further for .eslintrc files */
  "root": true,
  /* See all the pre-defined configs here: https://www.npmjs.com/package/eslint-config-defaults */
  "extends": [
    "eslint:recommended",
    "defaults/configurations/google"
  ],
  "ecmaFeatures": {
    "jsx": true
  },
  "env": {
    "browser": true,
    "node": true,
    "es6": true
  },

  "globals":{
    "angular": 1,
    "phoenix": 1,
    "requirejs": 1
  },
  "rules": {
    "indent": [
      2,
      2,
      { "SwitchCase": 1 }
    ],
    /* We don't do this consistently, so disable it as it is treated as an error otherwise */
    "newline-after-var": 0,
    "dot-location": [2, "property"],
    "no-extra-semi": 1,
    "semi": 2,
    "max-len": [2, 250, 2],

    "eqeqeq": 2,
    "comma-dangle": 1,
    "no-console": 0,
    "no-debugger": 1,
    "no-extra-parens": 1,
    "no-irregular-whitespace": 0,
    "no-undef": 1,
    "no-unused-vars": 2,
    "semi-spacing": 1
  }
}

0 个答案:

没有答案