Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
new format for jscs
// Deprecate and remove:
/*
* (require | disallow)SpacesInFunctionExpression
* (require | disallow)requireSpacesInFunction
*/
{
options: {
additionalRules: [],
plugins: [],
fileExtensions: [],
excludeFiles: [],
maxErrors: 50,
esnext: true
},
blocks: {
// requireCurlyBraces
curlyBraces: {
require: true || { "allExcept|only": [] },
},
// (require | disallow)NewlineBeforeBlockStatements
newlineBefore: {
require: true,
disallow: true
},
// requireBlocksOnNewline
onNewline: {
require: true || Number
},
// (require | disallow)PaddingNewlinesInBlocks
paddingNewlines: {
require: true,
disallow: false
}
// (require | disallow)SpaceBeforeBlockStatements
spaceBeforeStatements: {
require: true || { "allExcept|only": [] },
disallow: false || { "allExcept|only": [] }
},
// disallowEmptyBlocks
emptyBlocks: {
disallow: true
}
},
objects: {
// disallowSpacesInsideObjectBrackets
spacesInsideBrackets: {
require: true || { "allExcept|only": [] },
disallow: true || { "allExcept|only": [] }
},
// (require | disallow)SpaceAfterObjectKeys
// (require | disallow)SpaceBeforeObjectValues
spacesAroundColon: {
require: "before" || "after" || [ "before", "after" ],
disallow: "before" || "after" || [ "beforeColon", "after" ]
}
// (require | disallow)PaddingNewLinesInObjects
paddingNewLines: {
require: true,
disallow: false
},
// (require | disallow)commaBeforeLineBreak
commaBeforeLineBreak: {
require: true,
disallow: false
},
// requireAlignedObjectValues
alignedValues: {
require: true || "allExceptFunction" || "allExceptLineBreak" || [ "allExceptFunction" || "allExceptLineBreak" ],
},
// disallowQuotedKeysInObjects
quotedKeys: {
disallow: true || "allExceptReserved"
}
},
array: {
// (require | disallow)SpacesInsideArrayBrackets
spacesInside: {
require: true || { "allExcept|only": [] },
disallow: true || { "allExcept|only": [] }
},
},
parentheses: {
// (require | disallow)SpacesInsideParentheses
spacesInside: {
require: true || { "allExcept|only": [] },
disallow: true || { "allExcept|only": [] }
}
}
keywords: {
// (require | disallow)SpaceAfterKeywords
// (require | disallow)SpaceBeforeKeywords
spacesAround: {
"require": true || { "allExcept|only": [] },
"disallow": true || { "allExcept|only": [] }
},
// (require | disallow)PaddingNewlinesBeforeKeywords
paddingNewLines: {
"require": true || { "allExcept|only": [] },
"disallow": true || { "allExcept|only": [] }
}
}
spacesInFunction: {
// (require | disallow)SpacesInFunctionExpression
// (require | disallow)SpacesInAnonymousFunctionExpression
anonymousExpression: {
require: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ],
disallow: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ]
},
// (require | disallow)SpacesInNamedFunctionExpression
namedExpression: {
require: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ],
disallow: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ]
},
// (require | disallow)SpacesInFunctionDeclaration
declaration: {
require: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ],
disallow: "beforeOpeningParenthesis" || "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis", "beforeOpeningParenthesis" ]
},
// (require | disallow)SpacesInCallExpression
callExpression: {
require: "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis" ],
disallow: "beforeOpeningParenthesis" || [ "beforeOpeningParenthesis" ]
}
},
// (require | disallow)SpaceBeforeBinaryOperators
// (require | disallow)SpaceAfterBinaryOperators
binaryOperators: {
spacesAround: {
require: true || { "allExcept|only": [] },
disallow: true || { "allExcept|only": [] }
}
},
// (require | disallow)MultipleVarDecl
variables: {
declarations: {
require: "consecutive" || "one var" || "own statement" || "strict own statement"
},
// disallowDanglingUnderscores
danglingUnderscores: {
disallow: true || { "allExcept": [] }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.