Skip to content

Instantly share code, notes, and snippets.

@bryanstedman
Last active February 23, 2016 00:46
Show Gist options
  • Save bryanstedman/c62b163f83f7c05250ce to your computer and use it in GitHub Desktop.
Save bryanstedman/c62b163f83f7c05250ce to your computer and use it in GitHub Desktop.
My default JSCS config
{
// JSCS Configuration File
// See jscs.info for more details
"excludeFiles": [
"node_modules/**"
],
"disallowAnonymousFunctions" : null, // Requires that a function expression be named.
"disallowCapitalizedComments" : null, // Requires the first alphabetical character of a comment to be lowercase.
"disallowCommaBeforeLineBreak" : null, // Disallows commas as last token on a line in lists.
"disallowCurlyBraces" : null, // Disallows curly braces after statements.
"disallowDanglingUnderscores" : null, // Disallows identifiers that start or end in _.
"disallowEmptyBlocks" : null, // Disallows empty blocks (except for catch blocks).
"disallowFunctionDeclarations" : null, // Disallows function declarations.
"disallowIdentifierNames" : [], // Disallows a specified set of identifier names.
"disallowImplicitTypeConversion" : [], // Disallows implicit type conversion.
"disallowKeywordsInComments" : null, // Disallows keywords in your comments, such as TODO or FIXME
"disallowKeywordsOnNewLine" : [], // Disallows placing keywords on a new line.
"disallowKeywords" : [] , // Disallows usage of specified keywords.
"disallowMixedSpacesAndTabs" : "smart", // Requires lines to not contain both spaces and tabs consecutively, or spaces after tabs only for alignment if "smart"
"disallowMultipleLineBreaks" : null, // Disallows multiple blank lines in a row.
"disallowMultipleLineStrings" : true, // Disallows strings that span multiple lines without using concatenation.
"disallowMultipleSpaces" : {
"allowEOLComments": true
}, // Disallows multiple indentation characters (tabs or spaces) between identifiers, keywords, and any other token
"disallowMultipleVarDecl" : null, // Disallows multiple var declaration (except for-loop).
"disallowNamedUnassignedFunctions" : true, // Disallows unassigned functions to be named inline
"disallowNewlineBeforeBlockStatements" : true, // Disallows newline before opening curly brace of all block statements.
"disallowNodeTypes" : [], // Disallow use of certain node types (from Esprima/ESTree). Esprima node types
"disallowNotOperatorsInConditionals" : null, // Disallows the not, not equals, and strict not equals operators in conditionals.
"disallowObjectKeysOnNewLine" : null, // Disallows placing object keys on new line
"disallowOperatorBeforeLineBreak" : [], // Requires putting certain operators on the next line rather than on the current line before a line break.
"disallowPaddingNewLinesAfterBlocks" : null, // Disallow a newline after blocks
"disallowPaddingNewLinesAfterUseStrict" : null, // Disallow a blank line after 'use strict'; statements
"disallowPaddingNewLinesBeforeExport" : null, // Disallows newline before module.exports
"disallowPaddingNewlinesBeforeKeywords" : [], // Disallow an empty line above the specified keywords.
"disallowPaddingNewLinesBeforeLineComments" : null, // Disallows newline before line comments
"disallowPaddingNewlinesInBlocks" : null, // Disallows blocks from beginning or ending with 2 newlines.
"disallowPaddingNewLinesInObjects" : null, // Disallows newlines adjacent to curly braces in all object literals.
"disallowParenthesesAroundArrowParam" : true, // Disallows parentheses around arrow function expressions with a single parameter.
"disallowQuotedKeysInObjects" : null, // Disallows quoted keys in object if possible.
"disallowSemicolons" : null, // Disallows lines from ending in a semicolon.
"disallowSpaceAfterBinaryOperators" : [], // Requires sticking binary operators to the right.
"disallowSpaceAfterKeywords" : [], // Disallows space after keyword.
"disallowSpaceAfterLineComment" : null, // Requires that a line comment (//) not be followed by a space.
"disallowSpaceAfterObjectKeys" : null, // Disallows space after object keys.
"disallowSpaceAfterPrefixUnaryOperators" : true, // Requires sticking unary operators to the right.
"disallowSpaceBeforeBinaryOperators" : null, // Requires sticking binary operators to the left.
"disallowSpaceBeforeBlockStatements" : null, // Disallows space before block statements (for loops, control structures).
"disallowSpaceBeforeComma" : true, // Disallows spaces before commas
"disallowSpaceBeforeKeywords" : [], // Disallows space before keyword.
"disallowSpaceBeforeObjectValues" : null, // Disallows space after object keys.
"disallowSpaceBeforePostfixUnaryOperators" : true, // Requires sticking unary operators to the left.
"disallowSpaceBeforeSemicolon" : true, // Disallows spaces before semicolons.
"disallowSpaceBetweenArguments" : null, // Ensure there are no spaces after argument separators in call expressions.
"disallowSpacesInAnonymousFunctionExpression" : {
"beforeOpeningRoundBrace": true
}, // Disallows space before parenthesis and curly braces in anonymous function expressions.
"disallowSpacesInCallExpression" : true, // Disallows space before () in call expressions.
"disallowSpacesInConditionalExpression" : null, // Disallows space before and/or after question mark or colon in conditional expressions.
"disallowSpacesInForStatement" : null, // Disallow spaces in between for statement.
"disallowSpacesInFunctionDeclaration" : {
"beforeOpeningRoundBrace": true
}, // Disallows space before () or curly braces in function declarations.
"disallowSpacesInFunctionExpression" : {
"beforeOpeningRoundBrace": true
}, // Disallows space before () or curly braces in function expressions (both named and anonymous).
"disallowSpacesInFunction" : {
"beforeOpeningRoundBrace": true
}, // Disallows space before () or curly braces in function expressions (both named and anonymous) and function declarations.
"disallowSpacesInNamedFunctionExpression" : {
"beforeOpeningRoundBrace": true
}, // Disallows space before () or curly braces in named function expressions.
"disallowSpacesInsideArrayBrackets" : true, // Disallows space after opening array square bracket and before closing. Reports only on arrays, not on property accessors. Use disallowSpacesInsideBrackets to report on all brackets.
"disallowSpacesInsideBrackets" : true, // Disallows space after opening square bracket and before closing. Reports on all on brackets, even on property accessors. Use disallowSpacesInsideArrayBrackets to exclude property accessors.
"disallowSpacesInsideObjectBrackets" : true, // Disallows space after opening object curly brace and before closing.
"disallowSpacesInsideParentheses" : true, // Disallows space after opening round bracket and before closing.
"disallowTrailingComma" : true, // Disallows an extra comma following the final element of an array or object literal.
"disallowTrailingWhitespace" : true, // Requires all lines to end on a non-whitespace character
"disallowYodaConditions" : true, // Requires the variable to be the left hand operator when doing a boolean comparison
"jsDoc" : null, // Validate jsdoc comments
"maximumLineLength" : null, // Requires all lines to be at most the number of characters specified
"maximumNumberOfLines" : null, // Requires the file to be at most the number of lines specified
"requireAlignedObjectValues" : null, // Requires proper alignment in object literals.
"requireAnonymousFunctions" : null, // Requires that a function expression be anonymous.
"requireArrowFunctions" : null, // Requires that arrow functions are used instead of anonymous function expressions in callbacks.
"requireBlocksOnNewline" : 1, // Requires blocks to begin and end with a newline
"requireCamelCaseOrUpperCaseIdentifiers" : null, // Requires identifiers to be camelCased or UPPERCASE_WITH_UNDERSCORES
"requireCapitalizedComments" : null, // Requires the first alphabetical character of a comment to be uppercase, unless it is part of a multi-line textblock.
"requireCapitalizedConstructors" : true, // Requires constructors to be capitalized (except for this)
"requireCommaBeforeLineBreak" : true, // Requires commas as last token on a line in lists.
"requireCurlyBraces" : true, // Requires curly braces after statements.
"requireDollarBeforejQueryAssignment" : "ignoreProperties", // Require a $ before variable names that are jquery assignments.
"requireDotNotation" : true, // Requires member expressions to use dot notation when possible
"requireFunctionDeclarations" : true, // Requires function declarations by disallowing assignment of functions expressions to variables. Function expressions are allowed in all other contexts, including when passed as function arguments or immediately invoked.
"requireKeywordsOnNewLine" : null, // Requires placing keywords on a new line.
"requireLineBreakAfterVariableAssignment" : true, // Requires placing line feed after assigning a variable.
"requireLineFeedAtFileEnd" : true, // Requires placing line feed at file end.
"requireMatchingFunctionName" : null, // Requires function names to match member and property names.
"requireMultipleVarDecl" : null, // Requires multiple var declaration.
"requireNamedUnassignedFunctions" : null, // Require unassigned functions to be named inline
"requireNewlineBeforeBlockStatements" : null, // Requires newline before opening curly brace of all block statements.
"requireNumericLiterals" : null, // Requires use of binary, hexadecimal, and octal literals instead of parseInt.
"requireObjectKeysOnNewLine" : true, // Requires placing object keys on new line
"requireOperatorBeforeLineBreak" : null, // Requires operators to appear before line breaks and not after.
"requirePaddingNewLineAfterVariableDeclaration" : null, // Requires an extra blank newline after var declarations, as long as it is not the last expression in the current block.
"requirePaddingNewLinesAfterBlocks" : null, // Requires newline after blocks
"requirePaddingNewLinesAfterUseStrict" : true, // Requires a blank line after 'use strict'; statements
"requirePaddingNewLinesBeforeExport" : true, // Requires newline before module.exports
"requirePaddingNewlinesBeforeKeywords" : null, // Requires an empty line above the specified keywords unless the keyword is the first expression in a block.
"requirePaddingNewLinesBeforeLineComments" : null, // Requires newline before line comments
"requirePaddingNewlinesInBlocks" : null, // Requires blocks to begin and end with 2 newlines
"requirePaddingNewLinesInObjects" : false, // Requires newline inside curly braces of all objects.
"requireParenthesesAroundArrowParam" : null, // Requires parentheses around arrow function expressions with a single parameter.
"requireParenthesesAroundIIFE" : true, // Requires parentheses around immediately invoked function expressions.
"requireQuotedKeysInObjects" : null, // Requires quoted keys in objects.
"requireSemicolons" : true, // Requires semicolons
"requireShorthandArrowFunctions" : null, // Require arrow functions to use an expression body when returning a single statement (no block statement, implicit return).
"requireSpaceAfterBinaryOperators" : null, // Disallows sticking binary operators to the right.
"requireSpaceAfterKeywords" : null, // Requires space after keyword.
"requireSpaceAfterLineComment" : {
"allExcept": ["#", "="]
}, // Requires that a line comment (//) be followed by a space.
"requireSpaceAfterObjectKeys" : null, // Requires space after object keys.
"requireSpaceAfterPrefixUnaryOperators" : null, // Disallows sticking unary operators to the right.
"requireSpaceBeforeBinaryOperators" : null, // Disallows sticking binary operators to the left.
"requireSpaceBeforeBlockStatements" : null, // Requires space(s) before block statements (for loops, control structures).
"requireSpaceBeforeComma" : null, // Requires space before comma
"requireSpaceBeforeKeywords" : ["else"], // Requires space before keyword.
"requireSpaceBeforeObjectValues" : true, // Requires space after object keys.
"requireSpaceBeforePostfixUnaryOperators" : null, // Disallows sticking unary operators to the left.
"requireSpaceBetweenArguments" : true, // Ensure there are spaces after argument separators in call expressions.
"requireSpacesInAnonymousFunctionExpression" : {
"beforeOpeningCurlyBrace": true
}, // Requires space before () or curly braces in anonymous function expressions.
"requireSpacesInCallExpression" : null, // Requires space before () in call expressions.
"requireSpacesInConditionalExpression" : true, // Requires space before and/or after ? or colon in conditional expressions.
"requireSpacesInForStatement" : true, // Requires spaces inbetween for statement.
"requireSpacesInFunctionDeclaration" : {
"beforeOpeningCurlyBrace": true
}, // Requires space before () or curly braces in function declarations.
"requireSpacesInFunctionExpression" : {
"beforeOpeningCurlyBrace": true
}, // Requires space before () or curly braces in function expressions (both named and anonymous).
"requireSpacesInFunction" : {
"beforeOpeningCurlyBrace": true
}, // Requires space before () or curly braces in function expressions (both named and anonymous) and function declarations.
"requireSpacesInNamedFunctionExpression" : {
"beforeOpeningCurlyBrace": true
}, // Requires space before () or curly braces in named function expressions.
"requireSpacesInsideArrayBrackets" : null, // Requires space after opening array square bracket and before closing. Reports only on arrays, not on property accessors. Use requireSpacesInsideBrackets to report on all brackets.
"requireSpacesInsideBrackets" : null, // Requires space after opening square bracket and before closing. Reports on all on brackets, even on property accessors. Use requireSpacesInsideArrayBrackets to exclude property accessors.
"requireSpacesInsideObjectBrackets" : null, // Requires space after opening object curly brace and before closing.
"requireSpacesInsideParentheses" : null, // Requires space after opening round bracket and before closing.
"requireSpread" : null, // Disallows using .apply in favor of the spread operator
"requireTemplateStrings" : null, // Requires the use of template strings instead of string concatenation.
"requireTrailingComma" : null,
"requireVarDeclFirst" : null, // Requires var declaration to be on the top of an enclosing scope
"requireYodaConditions" : null, // Requires the variable to be the right hand operator when doing a boolean comparison
"safeContextKeyword" : null, // Option to check var that = this expressions
"validateAlignedFunctionParameters" : null, // Validates proper alignment of function parameters.
"validateIndentation" : 2, // Validates indentation for switch statements and block statements
"validateLineBreaks" : null, // Option to check line break characters
"validateNewlineAfterArrayElements" : null, // Requires each element in array on a single line when array length is more than passed maximum number or array fills more than one line. Set ignoreBrackets to true to allow elements on the same line with brackets.
"validateParameterSeparator" : ", ", // Enable validation of separators between function parameters. Will ignore newlines.
"validateQuoteMarks" : {
"mark": "'",
"escape": true
} // Requires all quote marks to be either the supplied value, or consistent if true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment