cssbrush
Alternative cli for csscomb with glob support and that only operates on changed files
csscomb
?
What's different compared to -
Specify the files to beautify using globs. e.g:
# operate only on the files that match the globcssbrush 'src/**/*.js' 'diff/**/*.js' -
Operate on changed files only. Useful if you run this tool as part of a
precommit
orprepush
hooks. By default, this module will remember files it beautified before, and only beautify them again if the files changed.The cache is stored inside your node_modules, add an entry to ignore
.cache
if you commit your code to your VCS -
Two new options added to the
csscomb.json
file:// adds a new line before each selector to nicely separate them.// set it to "" if you don't this behavior"space-before-selector": "\n"// how many empty lines you want to keep"max-empty-lines": "\n\n"
Install
npm i -g cssbrush
Usage
Here is the output of the --help
option
Usage: cssbrush [options] glob [glob1] [glob2]..[globN] Options: -k, --check-only Will just run the beautifier and report which files need to be beautified -i, --cache-id String An identifier
cssbrush 'path/to/files/**/*.less' # or css
Examples
# lint your code to see how many files need beautification # this will fail if some file need beautification cssbrush -k 'path/to/files/**/*.less' # do not use the cache # cssbrush --no-use-cache 'path/to/files/**/*.less'