chore(): add support for jscs

This commit is contained in:
Estevão Soares dos Santos 2015-01-19 14:53:53 +00:00
parent 79829dbbf1
commit 9ad3ac5cc0
4 changed files with 99 additions and 0 deletions

View File

@ -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;

93
.jscs.json Normal file
View File

@ -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
}

View File

@ -17,6 +17,7 @@
"strict": true,
"trailing": true,
"smarttabs": true,
"onevar": true,
"globals": {
"angular": true,
"module": true,

View File

@ -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"