A linter for immutable CSS. Inspired by csswizardry's immutable CSS article.
npm install --save immutable-css
npm i -g immutable-css
var immutableCss = require('immutable-css');
immutableCss('vendor.css', 'app.css');
// [{ selector: '.awesome', line: 5, column: 1, rule: {/* Rule Object */} }];
immutableCss('vendor.css', 'app.css', { verbose: true });
// app.css[line 5,col 1]: .awesome was mutated
verbose
(Boolean): Print output to standard out.ignoredSelectors
(Array): List of selectors to ignore for mutation violations.immutableSelectors
(Array): List of selectors to check against.
immutablecss vendor.css app.css app2.css
test/fixtures/app.css
test/fixtures/app.css[line 5,col 1]: .awesome was mutated
test/fixtures/app.css[line 9,col 1]: .awesome was mutated
test/fixtures/app.css[line 13,col 1]: .foo was mutated
test/fixtures/app.css[line 17,col 1]: .awesome was mutated
test/fixtures/app.css[line 21,col 1]: .awesome was mutated
test/fixtures/app2.css
test/fixtures/app2.css[line 1,col 1]: .foo was mutated
- https://github.com/postcss/postcss
- https://github.com/tj/commander.js
- https://www.npmjs.com/package/specificity
MIT
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by @jxnblk & @4lpine.
This package was initially generated with yeoman and the p generator.