Skip to content

henrikhelmers/immutable-css

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

immutable-css Build Status

A linter for immutable CSS. Inspired by csswizardry's immutable CSS article.

Installation

npm install --save immutable-css

For the CLI

npm i -g immutable-css

Usage

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

Options

  • 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.

Using the CLI

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

Acknowledgements

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by @jxnblk & @4lpine.


This package was initially generated with yeoman and the p generator.

About

[WIP] A linter for immutable CSS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%