- Ensures the whole team have the same code formatting standards
- Reduce time manually formatting as you know it will be fixed on every save
- Cleaner code!
Created
March 2, 2015 12:20
-
-
Save amorri40/e285beabf31cb417fee4 to your computer and use it in GitHub Desktop.
Prettify Javascript and HTML on every save with Grunt!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// # Prettify Javascript files | |
// | |
"jsbeautifier": { | |
files: ["<%= config.app %>/js/*{,*/}*.js", './dashboards/**/*.js', './app/**/*.js', './bin/**/*.js'], | |
options: {} | |
}, | |
// | |
// # Prettify HTML files | |
// | |
prettify: { | |
options: { | |
config: '.prettifyrc' | |
}, | |
all: { | |
expand: true, | |
cwd: '<%= config.app %>/../', | |
src: ['{,*/}*.html', './dashboards/**/*.html', './app/**/*.html'], | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bower install grunt-prettify --save-dev | |
bower install grunt-jsbeautifier --save-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment