Sublime Forum

Question about sublimelinter - jshint & csslint

#1

Hello. Yesterday i installed Sublimelinter becouse i wanted to use the plugins “jshint & csslint”.

In package Control i installed sublimelinter and then sublimeLinter-jshint and sublimeLinter-csslint. After that i went to nodejs and typed these two texts:
npm install -g jshint
npm install -g csslint

Now the two plugins seems to work however i got 2 problems.
the cssLint is not warning which order i write the styles? lets say
p {
width: 100px;
height: 100px;
}

Shouldn’t the cssLint warn me that height should be before width?

Also the jshint seems to work perferctly but it doesn’t warn about the tabs? lets say
if(a == b) {
console.log(“hello”)
}

Everything on the same tab line and it says nothing?

Could anyone help me with these 2 things?

Thanks in advance /Ruffy

0 Likes

#2

Both csslint and jshint need to be configured.

Jshint needs a jshintrc file in the project folder or, in an arbitrary path that should be pointed in sublimelinter settings like:
"jshint": { "@disable": false, "args": [ "--config", "/path/to/my/.jshintrc" ], "excludes": [] }

For csslint you can fine tune it in the same sublimelinter settings’ file, for example, here’s mine:
"csslint": { "@disable": false, "args": [], "errors": "ids,display-property-grouping,duplicate-properties,empty-rules,errors,known-properties,vendor-prefix", "excludes": [], "ignore": "", "warnings": "adjoining-classes,box-model,box-sizing,compatible-vendor,duplicate-background,fallback-colors,floats,font-faces,font-sizes,gradients,import,important,outline-none,overqualified-elements,qualified-headings,regex-selectors,rules-count,shorthand,star-property,text-indent,underscore-property,unique-headings,universal-selector,zero-units" }

hope it helps :wink:

0 Likes

#3

Thanks for your reply!

Where do i get jshintrc & jscsrc files?

Also i tried the your css settings but no change. The lint works but it doesn’t tell me which order to write the styles. Like my previous example :
p {
width: 100px;
height: 100px;
}

It should tell me height should be set before width, (alphabetical order) ?

0 Likes