prep for using js-beautify

This commit is contained in:
mike 2016-06-25 14:10:10 -04:00
parent 68e35d2b0d
commit b9410572ea
4 changed files with 29 additions and 0 deletions

11
.jsbeautifyrc Normal file
View File

@ -0,0 +1,11 @@
{
"allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"],
"end_with_newline": true,
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true
}

6
.jsbeautifyrc-css Normal file
View File

@ -0,0 +1,6 @@
{
"allowed_file_extensions": ["css", "scss", "sass", "less"],
"indent_size": 2,
"selector_separator_newline": true,
"newline_between_rules": true
}

6
.jsbeautifyrc-html Normal file
View File

@ -0,0 +1,6 @@
{
"allowed_file_extensions": ["htm", "html"],
"indent_size": 4,
"preserve_newlines": true,
"max_preserve_newlines": 1
}

6
utils/beautify.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
find src -type f -not -path "*tests*" -name '*.js' | xargs -n1 js-beautify --config .jsbeautifyrc -r
find src -type f -not -path "*tests*" -name '*.css' | xargs -n1 css-beautify --config .jsbeautifyrc-css -r
find src -type f -not -path "*tests*" -name '*.scss' | xargs -n1 css-beautify --config .jsbeautifyrc-css -r
find src -type f -not -path "*tests*" -name '*.html' | xargs -n1 html-beautify --config .jsbeautifyrc-html -r
html-beautify --config .jsbeautifyrc-html -r example.html