From 9ad3ac5cc0f29fb6712c02ce54e05bd37626fde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Mon, 19 Jan 2015 14:53:53 +0000 Subject: [PATCH] chore(): add support for jscs --- .editorconfig | 4 +++ .jscs.json | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ .jshintrc | 1 + package.json | 1 + 4 files changed, 99 insertions(+) create mode 100644 .jscs.json diff --git a/.editorconfig b/.editorconfig index 4c1b2fc..563987c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,7 @@ [*.js] indent_style = space; indent_size = 2; +continuation_indent_size = 2; insert_final_newline = true; quote_type = single; space_after_anonymous_functions = true; @@ -8,4 +9,7 @@ space_after_control_statements = true; spaces_around_operators = true; trim_trailing_whitespace = true; spaces_in_brackets = false; +curly_bracket_next_line = true; +indent_brace_style = 1TBS; end_of_line = lf; +charset = utf-8; diff --git a/.jscs.json b/.jscs.json new file mode 100644 index 0000000..c348b55 --- /dev/null +++ b/.jscs.json @@ -0,0 +1,93 @@ +{ + "requireCurlyBraces": [ + "if", + "else", + "for", + "while", + "do", + "try", + "catch" + ], + "requireOperatorBeforeLineBreak": true, + "requireCamelCaseOrUpperCaseIdentifiers": true, + "maximumLineLength": { + "value": 80, + "allowComments": true, + "allowRegex": true + }, + "validateIndentation": 2, + "validateQuoteMarks": "'", + "disallowMultipleLineStrings": true, + "disallowMixedSpacesAndTabs": true, + "disallowTrailingWhitespace": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "requireMultipleVarDecl": true, + "disallowKeywordsOnNewLine": ["else"], + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "return", + "try", + "catch" + ], + "requireSpaceBeforeBinaryOperators": [ + "=", + "+=", + "-=", + "*=", + "/=", + "%=", + "<<=", + ">>=", + ">>>=", + "&=", + "|=", + "^=", + "+=", + "+", + "-", + "*", + "/", + "%", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + "&&", + "||", + "===", + "==", + ">=", + "<=", + "<", + ">", + "!=", + "!==" + ], + "requireSpaceAfterBinaryOperators": true, + "requireSpacesInConditionalExpression": true, + "requireSpaceBeforeBlockStatements": true, + "requireSpacesInForStatement": true, + "requireLineFeedAtFileEnd": true, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInAnonymousFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInsideObjectBrackets": "all", + "disallowSpacesInsideArrayBrackets": "all", + "disallowSpacesInsideParentheses": true, + "validateJSDoc": { + "checkParamNames": true, + "requireParamTypes": true + }, + "disallowMultipleLineBreaks": true, + "disallowNewlineBeforeBlockStatements": true +} diff --git a/.jshintrc b/.jshintrc index a830c8e..0dfea06 100644 --- a/.jshintrc +++ b/.jshintrc @@ -17,6 +17,7 @@ "strict": true, "trailing": true, "smarttabs": true, + "onevar": true, "globals": { "angular": true, "module": true, diff --git a/package.json b/package.json index fc730db..70d9e57 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-uglify": "^0.6.0", "grunt-simple-mocha": "^0.4.0", + "jscs": "^1.10.0", "mocha": "*", "should": "^4.4.2", "source-map-support": "^0.2.9"