Sublime Forum

[SublimeLinter] How to add an ignore rule in csslint?

#1

Hello. I am using the csslint package in SublimeLinter. I am trying to instruct it to ignore a certain rule–the order-alphabetical rule on this page. But how do I do that exactly?

I found this page with instructions. I added that code to my SublimeLinter preferences.

"csslint": {
                "@disable": false,
                "ignore": "important,ids"
            }

But when I tried to save it, was met with an error: Error trying to parse settings: Unexpected trailing characters in Packages\User\SublimeLinter.sublime-settings:12:1 (screenshot). I tried adding brackets around the code, but the same error resulted. I also tried adding the same code to the SublimeText preferences, but had the same issue.

Thanks in advance.

0 Likes

#2

The whole contents of the file has to be a valid JSON object, but it’s not; the 12:1 is telling you that the file contains unexpected data at line 12, column 1. which is the start of the "csslint" key in your post above.

If you add a comma after the } that closes the "paths" portion on line 9 and then move the whole "csslint" portion to between lines 9 and 10, the settings file should be valid.

That said, I don’t use SublimeLinter or csslint so I can’t speak to whether or not the settings being valid will 100% fix everything.

0 Likes

#3

OK thanks for that. The comma was what I forgot to try. I did so, and was met with another error:

SublimeLinter: ERROR: Invalid settings in ‘Packages/User/SublimeLinter.sublime-settings’:
Additional properties are not allowed (‘csslint’ was unexpected)

(screenshot). Thoughts?

0 Likes

#4

I’m afraid I can’t help with that, unfortunately; I don’t use either of those packages so I’m not familiar with how you would configure them or what options they expect.

Hopefully someone that uses the package will be able to chime in on how to accomplish this particular goal.

0 Likes

#6

Bingo that did it. Thank you!

0 Likes