Skip to content

Instantly share code, notes, and snippets.

@amorri40
Created March 2, 2015 12:20
Show Gist options
  • Save amorri40/e285beabf31cb417fee4 to your computer and use it in GitHub Desktop.
Save amorri40/e285beabf31cb417fee4 to your computer and use it in GitHub Desktop.
Prettify Javascript and HTML on every save with Grunt!
  • 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!
//
// # 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'],
}
},
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