简体   繁体   中英

How to set `.sublimelinterrc` with CSSlint preferences for SublimeLinter?

I'm trying to configure a .sublimelinterrc file for SublimeLinter and CSSlint, I've wrote a rules list example but it won't work and continues to lint it with default rules, this is my config:

{
"linters":{
    "csslint": {
        "@disable": false,
        "errors": [
            "non-link-hover, ids, display-property-grouping, empty-rules, underscore-property-hack, star-property-hack, text-indent"
        ],
        "ignore": [
            "box-model, adjoining-classes, import, universal-selector, overqualified-elements, floats, font-sizes, important, unique-headings"
        ],
        "warnings": [
            "known-properties, duplicate-properties, qualified-headings, duplicate-background-images, shorthand, zero-units, unqualified-attributes, regex-selectors, font-faces, bulletproof-font-face, fallback-colors, vendor-prefix, gradients, compatible-vendor-prefixes"
        ]
    }
}
}

I'm srure SublimeLinter and SublimeLInter-csslint and working.

How should I write the .sublimelinterrc file?

try

{
    "linters":{
        "csslint": {
            "@disable": false,
            "errors": [
                "non-link-hover", "ids", "display-property-grouping", "empty-rules", "underscore-property-hack", "star-property-hack", "text-indent"],
            "ignore": [
                "box-model", "adjoining-classes", "import", "universal-selector", "overqualified-elements", "floats", "font-sizes", "important", "unique-headings"
            ],
            "warnings": [
                "known-properties", "duplicate-properties", "qualified-headings", "duplicate-background-images", "shorthand", "zero-units", "unqualified-attributes", "regex-selectors", "font-faces", "bulletproof-font-face", "fallback-colors", "vendor-prefix", "gradients", "compatible-vendor-prefixes"
            ]
        }
    }
}

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