From ccc8802f36fe15c4f29abffcd974cb0c7d1acdad Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Sun, 28 Sep 2014 17:28:51 -0300 Subject: [PATCH] Fixes #96. Fix support for Alphasort option for LESS/SCSS properties --- examples/simple-jsbeautifyrc/.jsbeautifyrc | 2 +- examples/simple-jsbeautifyrc/alphasort1.scss | 4 ++++ lib/langs/less-beautify.coffee | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 examples/simple-jsbeautifyrc/alphasort1.scss diff --git a/examples/simple-jsbeautifyrc/.jsbeautifyrc b/examples/simple-jsbeautifyrc/.jsbeautifyrc index bd461289b..650b9c1bd 100644 --- a/examples/simple-jsbeautifyrc/.jsbeautifyrc +++ b/examples/simple-jsbeautifyrc/.jsbeautifyrc @@ -8,5 +8,5 @@ "max_preserve_newlines": 2, "jslint_happy": true, "indent_handlebars": true, - "object": {} + "object": {} } diff --git a/examples/simple-jsbeautifyrc/alphasort1.scss b/examples/simple-jsbeautifyrc/alphasort1.scss new file mode 100644 index 000000000..9b5e86b2b --- /dev/null +++ b/examples/simple-jsbeautifyrc/alphasort1.scss @@ -0,0 +1,4 @@ +.example(){ + .base-apple(); // Sets base apple color to red + .apple-color(@color-green); // Sets apple color to green +} diff --git a/lib/langs/less-beautify.coffee b/lib/langs/less-beautify.coffee index 2edb1dce6..b1ff4927d 100644 --- a/lib/langs/less-beautify.coffee +++ b/lib/langs/less-beautify.coffee @@ -7,6 +7,7 @@ module.exports = (text, options, callback) -> mode: "beautify" inchar: options.indent_character insize: options.indent_size + alphasort: options.alphasort || false output = prettydiff.api(args) result = output[0]