Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Last active November 2, 2018 19:49
Show Gist options
  • Save sindresorhus/8141244 to your computer and use it in GitHub Desktop.
Save sindresorhus/8141244 to your computer and use it in GitHub Desktop.
My code style file
{
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowMultipleVarDecl": true,
"disallowSpacesInsideObjectBrackets": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireRightStickedOperators": ["!"],
"disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireLeftStickedOperators": [","],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"],
"disallowKeywords": ["with", "eval"],
"disallowMultipleLineBreaks": true,
"validateLineBreaks": "LF",
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"safeContextKeyword": "self",
"excludeFiles": ["node_modules/**", "bower_components/**"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment