A grunt wrapper for Jade-Beautify (now Pug-Beautify).
Issues regarding rules should be reported on the PugBeautify issue tracker as it's the actual beautifier.
$ npm install --save-dev grunt-pug-beautify
module.exports = function(grunt) {
grunt.initConfig({
pugbeautify: {
all: {
expand: true,
cwd: 'fixtures/',
src: '*.jade',
dest: 'dist/',
options: { omit_empty_lines: true }
}
}
});
grunt.loadTasks('grunt-pug-beautify');
grunt.registerTask('default', ['pugbeautify']);
};
In the gruntfile you can specify the following options:
- Type:
boolean
- Default:
'false'
Omits all empty new lines (except at EOF)
You can also specify the following options (parsed by pug-beautify):
- Type:
boolean
- Default:
'true'
Indent using tabs or spaces
- Type:
boolean
- Default:
'false'
Whether to omit div
tag [div.hello(attr=..)
becomes .hello(attr=..)
]
- Type:
number
- Default:
'false'
When fill_tab
is set to false
, indents using spaces, default is 2.
npm test
npm install
All code in any code-base should look like a single person typed it, no matter how many people contributed.
MIT © Pierre Cholhot