Skip to content

Instantly share code, notes, and snippets.

@thelinuxlich
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thelinuxlich/9256481 to your computer and use it in GitHub Desktop.
Save thelinuxlich/9256481 to your computer and use it in GitHub Desktop.
JSCS flags

####requireSpaceAfterKeywords

Requires space after keyword.

####requireSpacesInFunctionExpression

Requires space before () or {} in function declarations.

####requireSpacesInAnonymousFunctionExpression

Requires space before () or {} in anonymous function expressions.

####requireSpacesInNamedFunctionExpression

Requires space before () or {} in named function expressions.

####disallowMultipleVarDecl

Disallows multiple var declaration (except for-loop).

####requireBlocksOnNewline

Requires blocks to begin and end with a newline

####disallowEmptyBlocks

Disallows empty blocks (except for catch blocks).

####requireSpacesInsideObjectBrackets

Requires space after opening object curly brace and before closing.

####requireSpacesInsideArrayBrackets

Requires space after opening array square bracket and before closing.

####disallowQuotedKeysInObjects

Disallows quoted keys in object if possible.

####disallowSpaceAfterObjectKeys

Disallows space after object keys.

####disallowCommaBeforeLineBreak

Disallows commas as last token on a line in lists.

####requireAlignedObjectValues

Requires proper alignment in object literals.

####requireOperatorBeforeLineBreak

Requires operators to appear before line breaks and not after.

####disallowLeftStickedOperators

Disallows sticking operators to the left.

####disallowRightStickedOperators

Disallows sticking operators to the right.

####disallowSpaceAfterPrefixUnaryOperators

Requires sticking unary operators to the right.

####disallowSpaceBeforePostfixUnaryOperators

Requires sticking unary operators to the left.

####requireSpaceBeforeBinaryOperators

Disallows sticking binary operators to the left.

####requireSpaceAfterBinaryOperators

Disallows sticking binary operators to the right.

####disallowKeywords

Disallows usage of specified keywords.

####disallowMultipleLineBreaks

Disallows multiple blank lines in a row.

####requireLineFeedAtFileEnd

Requires placing line feed at file end.

####disallowYodaConditions

Requires the variable to be the left hand operator when doing a boolean comparison

@thelinuxlich
Copy link
Author

I vote against:

requireSpacesInFunctionExpression (use only for {})
requireSpacesInAnonymousFunctionExpression (use only for {})
requireSpacesInNamedFunctionExpression (use only for {})
disallowEmptyBlocks
requireSpacesInsideObjectBrackets
requireSpacesInsideArrayBrackets
disallowCommaBeforeLineBreak
requireAlignedObjectValues
requireLineFeedAtFileEnd

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