Skip to content

Instantly share code, notes, and snippets.

@tbranyen
Created February 10, 2014 19:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbranyen/8922785 to your computer and use it in GitHub Desktop.
Save tbranyen/8922785 to your computer and use it in GitHub Desktop.
My JSCS style configuration.
{
"maximumLineLength": 80,
"validateJSDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true
},
"validateLineBreaks": "LF",
"validateQuoteMarks": true,
"validateIndentation": 2,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireOperatorBeforeLineBreak": [
"?",
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"requireSpaceBeforeBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"requireSpaceAfterBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"requireRightStickedOperators": [
"!"
],
"requireLeftStickedOperators": [
","
],
"requireKeywordsOnNewLine": [
"else",
"catch",
"while"
],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireParenthesesAroundIIFE": true,
"requireCommaBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"disallowLeftStickedOperators": [
"?",
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"disallowSpaceAfterPrefixUnaryOperators": [
"++",
"--",
"+",
"-",
"~",
"!"
],
"disallowRightStickedOperators": [
"?",
"+",
"/",
"*",
":",
"=",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"disallowSpaceBeforePostfixUnaryOperators": [
"++",
"--"
],
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
"disallowKeywords": [
"with"
],
"disallowMultipleLineStrings": true,
"disallowMultipleLineBreaks": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowTrailingWhitespace": true,
"disallowMixedSpacesAndTabs": "smart"
}
@tbranyen
Copy link
Author

@michael-benin-CN just check out the options compared to JSHint. JSCS handles things like braces on different lines, IIFE style, jsdoc style, etc. These aren't things that JSHint can handle as it works with an AST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment