简体   繁体   中英

Sublime Text 3 CSSLint Package not using .csslintrc

I'm trying to use CSSLint with Sublime Text 3, but I can't seem to get it to use the .csslintrc file I've got in my project root.

Originally I thought it would be in JSON format, but then it turned out you have to use a command line syntax, so as a test I tried these in my .csslintrc file:

--ignore=ids,important

and

ignore=ids,important

But neither stop the linter from warning about the use of either??? Any suggestions? It does work if I just stick it in the user settings file, but since I use .jshintrc and other files in my projects for linting etc, and not everyone uses Sublime Text (I don't know why they wouldn't :), I'd prefer to have it all in .csslintrc

"linters": {
    "csslint": {
        "@disable": false,
        "args": [],
        "errors": "",
        "excludes": [],
        "ignore": "ids,important", // WORKS
        "warnings": ""
    },
}

First solution, you can add a .csslintrc file in the CSS folder (and duplicate it for each sub folder...) :

--ignore=ids,important

Otherwise, you can add a .sublimelinterrc file in your project root :

{
    "linters": {
        "csslint": {
          "ignore": ["ids, important"]
        }
      }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM