an esformatter plugin to make esformatter ignore certain lines and blocks of code
Overview
esformatter-ignore is a plugin for esformatter meant to allow
certain lines and blocks of code to be ignored by esformatter
Example
var someVar = 'foo';
if (someVar) {
cache.setKey( 'persistifyArgs', {
cache: browserifyOpts.cache,
packageCache: browserifyOpts.packageCache
} );
}
If you want to ignore only a single line you can also do it by doing
if (someKey) {
delete objectCache[someKey];
}
Installation
$ npm install esformatter-ignore --save-dev
Config
Newest esformatter versions autoload plugins from your node_modules
See this
Add to your esformatter config file:
In order for this to work, this plugin should be the first one! (I Know too picky, but who isn't).
{
"plugins": [
"esformatter-ignore"
]
}
Or you can manually register your plugin:
esformatter.register(require('esformatter-ignore'));
node usage
var fs = require('fs');
var esformatter = require('esformatter');
esformatter.register(require('esformatter-ignore'));
var str = fs.readFileSync('./someKewlFile.js').toString();
var output = esformatter.format(str);
See esformatter for more options and further usage info.
License
MIT