Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'ClassDeclaration[superClass], ClassExpression[superClass]'(node) {
const classToken = sourceCode.getFirstToken(node);
const extendsToken = sourceCode.getTokenBefore(node.superClass, eslint_utils_1.isNotOpeningParenToken);
offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1);
},
ConditionalExpression(node) {
function addBlocklessNodeIndent(node) {
if (node.type !== 'BlockStatement') {
const lastParentToken = sourceCode.getTokenBefore(node, eslint_utils_1.isNotOpeningParenToken);
let firstBodyToken = sourceCode.getFirstToken(node);
let lastBodyToken = sourceCode.getLastToken(node);
while (eslint_utils_1.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) &&
eslint_utils_1.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken))) {
firstBodyToken = sourceCode.getTokenBefore(firstBodyToken);
lastBodyToken = sourceCode.getTokenAfter(lastBodyToken);
}
offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1);
/*
* For blockless nodes with semicolon-first style, don't indent the semicolon.
* e.g.
* if (foo) bar()
* ; [1, 2, 3].map(foo)
*/
const lastToken = sourceCode.getLastToken(node);
if (lastToken &&