Last active
August 29, 2015 14:06
-
-
Save bryanforbes/f5f6c13824e0237817de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"requireCurlyBraces": [ | |
"if", "else", "for", "while", "do", "try", | |
"catch" | |
], | |
"requireSpaceAfterKeywords": [ | |
"if", "else", "for", "while", "do", "switch", | |
"return", "try", "catch" | |
], | |
"requireSpaceBeforeBlockStatements": true, | |
"requireParenthesesAroundIIFE": true, | |
"requireSpacesInConditionalExpression": true, | |
"requireSpacesInAnonymousFunctionExpression": { | |
"beforeOpeningRoundBrace": true, | |
"beforeOpeningCurlyBrace": true | |
}, | |
"requireSpacesInNamedFunctionExpression": { | |
"beforeOpeningCurlyBrace": true | |
}, | |
"disallowSpacesInNamedFunctionExpression": { | |
"beforeOpeningRoundBrace": true | |
}, | |
"requireSpacesInFunctionDeclaration": { | |
"beforeOpeningCurlyBrace": true | |
}, | |
"disallowSpacesInFunctionDeclaration": { | |
"beforeOpeningRoundBrace": true | |
}, | |
"disallowMultipleVarDecl": true, | |
"requireBlocksOnNewline": true, | |
"disallowEmptyBlocks": true, | |
"requireSpacesInsideObjectBrackets": "allButNested", | |
"requireSpacesInsideArrayBrackets": "allButNested", | |
"disallowQuotedKeysInObjects": "allButReserved", | |
"disallowSpaceAfterObjectKeys": true, | |
"requireCommaBeforeLineBreak": true, | |
"requireOperatorBeforeLineBreak": true, | |
"disallowSpaceAfterPrefixUnaryOperators": true, | |
"disallowSpaceBeforePostfixUnaryOperators": true, | |
"requireSpaceBeforeBinaryOperators": true, | |
"requireSpaceAfterBinaryOperators": true, | |
"disallowImplicitTypeConversion": [ | |
"binary" | |
], | |
"requireCamelCaseOrUpperCaseIdentifiers": true, | |
"disallowKeywords": [ | |
"with" | |
], | |
"disallowMultipleLineStrings": true, | |
"disallowMultipleLineBreaks": true, | |
"validateQuoteMarks": { | |
"mark": "'", | |
"escape": true | |
}, | |
"validateIndentation": "\t", | |
"disallowMixedSpacesAndTabs": "smart", | |
"disallowTrailingWhitespace": true, | |
"disallowTrailingComma": true, | |
"requireKeywordsOnNewLine": [ | |
"else" | |
], | |
"requireLineFeedAtFileEnd": true, | |
"maximumLineLength": 120, | |
"requireCapitalizedConstructors": true, | |
"requireDotNotation": true, | |
"disallowYodaConditions": true, | |
"requireSpaceAfterLineComment": true | |
} |
Thanks for the suggestions, Ken. I have updated them all except for the following:
- I'd like more input on
"disallowMultipleLineBreaks": true
before removing it. - Since git takes care of line break normalization, I'd rather not add
"validateLineBreaks": "LF"
.
Some other comments:
- The
"disallowSpaceBeforeBinaryOperators": [ ":" ]
rule was to get around a bug in jscs which has since been fixed. - The exact reason I chose
escape: true
forvalidateQuoteMarks
was for locale strings.
Once the two issues you noted get resolved, I think this config file is good to go.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A couple more comments:
allButNested
, I see why it's useful now (e.g.[{ ... }]
... mysteriously though, it's not working for me locally :/allButNested
only covers arrays-in-arrays and objects-in-objects. See jscs-dev/node-jscs#111requireSpaceAfterLineComment
gripes at dojo-doc style comments because apparently it considers tab to not be spacey enough. I had to remove it when testing this against dgrid.