Skip to content

Instantly share code, notes, and snippets.

@otterthecat
Last active August 29, 2015 14:03
Show Gist options
  • Save otterthecat/e08951cf5c79a5cefe6d to your computer and use it in GitHub Desktop.
Save otterthecat/e08951cf5c79a5cefe6d to your computer and use it in GitHub Desktop.
Config for formatting javascript via JSCS
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
"finally",
"case",
"default"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"disallowMultipleVarDecl": true,
"requireBlocksOnNewline": 1,
"disallowPaddingNewLinesInBlocks": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideObjectBrackets": "all",
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowDanglingUnderscores": true,
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"requireAlignedObjectValues": "all",
"requireOperatorBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary"
],
"requireCamelCaseOrUpperCaseIdentifiers": true,
"disallowMultipleLineStrings": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"mark": "'",
"escape": true
},
"validateIndentation": 2,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"requireKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"maximumLineLength": 80,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"disallowYodaConditions": true,
"requireSpaceAfterLineComment": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment