Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use csslint from the command line?

I'm new to Ubuntu, I'll be the first to admit that, but I need to integrate csslint into a CI build script and I found the about page on the csslint site unhelpful. It gave me two options for installing csslint but they require either node or rhino:

Node.js:
sudo npm install -g csslint

Rhino.js:
java -jar rhino.jar csslint-rhino.js --rules= ~ /* suppressed for simplicity */

After googling for either of these in a format I know how to work with, on google groups I found someone asking a similar question. The answer was that rhino is not a ready made product you install and run but a library you work with.

All I need to do is:

  • pass CSS files to csslint through bash with csslint args
  • get the response back
  • evaluate whether or not the build should fail due to violations

Is there anywhere I can find step-by-step instructions that include dependencies such as node or rhino?

Thanks everyone.

like image 320
Nickel Avatar asked Nov 05 '12 14:11

Nickel


1 Answers

Found the answer myself and decided to put it here to help others.

sudo apt-get install npm

sudo npm install -g csslint

csslint pathtofile.css

have feelings hurt.

like image 95
2 revs, 2 users 84% Avatar answered Oct 18 '22 18:10

2 revs, 2 users 84%