Adding John Papa style guide to JSCS

As we add more javascripts, we need to enforce them. These rules are taken
from JP's website directly. Currently there are 15,406 errors, we need to
address these first before merging this patch. Those are in subsequent patches.

Change-Id: I31d50ead95d502b0463dcd1f378d257b7975e50b
Partially-Implements: blueprint jscs-cleanup
Ref: https://github.com/johnpapa/angular-styleguide#style-y235
This commit is contained in:
Thai Tran 2015-05-28 14:52:56 -07:00 committed by Cindy Lu
parent bef33a61c5
commit a6cd2c8e62

55
.jscsrc
View File

@ -1,3 +1,54 @@
{
"disallowTrailingWhitespace": true
}
"excludeFiles": [
"node_modules/**",
"bower_components/**"
],
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireOperatorBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
"maximumLineLength": {
"value": 100,
"allowComments": true,
"allowRegex": true
},
"validateIndentation": 2,
"disallowMultipleLineStrings": true,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowMultipleVarDecl": "exceptUndefined",
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": [
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=", "+=",
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
"|", "^", "&&", "||", "===", "==", ">=",
"<=", "<", ">", "!=", "!=="
],
"requireSpaceAfterBinaryOperators": true,
"requireSpacesInConditionalExpression": true,
"requireSpaceBeforeBlockStatements": true,
"requireLineFeedAtFileEnd": true,
"disallowMultipleLineBreaks": true,
"disallowTrailingComma": true,
"requireParenthesesAroundIIFE": true
}