Skip to content

Instantly share code, notes, and snippets.

@bryanforbes
Last active August 29, 2015 14:06
Show Gist options
  • Save bryanforbes/f5f6c13824e0237817de to your computer and use it in GitHub Desktop.
Save bryanforbes/f5f6c13824e0237817de to your computer and use it in GitHub Desktop.
{
"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
}
@bryanforbes
Copy link
Author

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 for validateQuoteMarks 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