Permalink
Browse files

Setup beautify and jshint to run on project files

  • Loading branch information...
1 parent 45bfe4d commit 9680b5f1e62854c4959315665518a10a84288452 @bitwiseman bitwiseman committed Feb 4, 2016
View
@@ -0,0 +1,9 @@
+js/bin/**
+js/test/resources/**
+node_modules/**
+python/**
+target/**
+tools/**
+test/underscore-min.js
+test/underscore.js
+web/third-party/**
View
@@ -0,0 +1,5 @@
+{
+ "curly": true,
+ "eqeqeq": true,
+ "nocomma": true
+}
View
@@ -879,13 +879,15 @@ if (!Object.values) {
if (is_array(previous_flags.mode) && (last_type === 'TK_START_EXPR' || last_type === 'TK_COMMA')) {
// if we're preserving inline,
// allow newline between comma and next brace.
- if (flags.inline_frame) {
+ if (last_type === 'TK_COMMA' || opt.space_in_paren ) {
+ output.space_before_token = true;
+ }
+
+ if (opt.brace_style === 'collapse-preserve-inline' &&
+ (last_type === 'TK_COMMA' || (last_type === 'TK_START_EXPR' && flags.inline_frame ))) {
allow_wrap_or_preserved_newline();
- flags.inline_frame = true;
previous_flags.multiline_frame = previous_flags.multiline_frame || flags.multiline_frame;
flags.multiline_frame = false;
- } else if (last_type === 'TK_COMMA') {
- output.space_before_token = true;
}
} else if (last_type !== 'TK_OPERATOR' && last_type !== 'TK_START_EXPR') {
if (last_type === 'TK_START_BLOCK') {
@@ -194,6 +194,7 @@ test_cli_js_beautify()
unset HOME
export USERPROFILE=$SCRIPT_DIR/resources/indent11chars
+ # node -p 'process.env["USERPROFILE"] || process.env["HOME"] || "unset"'
$CLI_SCRIPT $TEST_TEMP/example1-default.js | diff -q $TEST_TEMP/example1-indent11chars.js - || {
echo "js-beautify output for $TEST_TEMP/example1-default.js was expected to be identical for same HOME and USERPROFILE settings."
cleanup 1
View
@@ -0,0 +1,18 @@
+{
+ "indent_size": 4,
+ "indent_char": " ",
+ "indent_level": 0,
+ "indent_with_tabs": false,
+ "preserve_newlines": true,
+ "max_preserve_newlines": 10,
+ "jslint_happy": false,
+ "space_after_anon_function": false,
+ "brace_style": "collapse-preserve-inline",
+ "keep_array_indentation": false,
+ "keep_function_indentation": false,
+ "space_before_conditional": true,
+ "break_chained_methods": false,
+ "eval_code": false,
+ "unescape_strings": false,
+ "wrap_line_length": 0
+}
View
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9680b5f

Please sign in to comment.