diff --git a/src/rules/valid-expect.ts b/src/rules/valid-expect.ts index d951060..4f52065 100644 --- a/src/rules/valid-expect.ts +++ b/src/rules/valid-expect.ts @@ -75,9 +75,9 @@ function getParentIfThenified(node: TSESTree.Node): TSESTree.Node { const findPromiseCallExpressionNode = (node: TSESTree.Node) => node.parent?.parent - && [AST_NODE_TYPES.CallExpression, AST_NODE_TYPES.ArrayExpression].includes( - node.parent.type - ) + && [AST_NODE_TYPES.CallExpression, AST_NODE_TYPES.ArrayExpression].includes( + node.parent.type + ) ? getPromiseCallExpressionNode(node.parent) : null @@ -94,10 +94,10 @@ const isAcceptableReturnNode = ( node: TSESTree.Node, allowReturn: boolean ): node is - | TSESTree.ConditionalExpression - | TSESTree.ArrowFunctionExpression - | TSESTree.AwaitExpression - | TSESTree.ReturnStatement => { +| TSESTree.ConditionalExpression +| TSESTree.ArrowFunctionExpression +| TSESTree.AwaitExpression +| TSESTree.ReturnStatement => { if (allowReturn && node.type === AST_NODE_TYPES.ReturnStatement) return true @@ -248,7 +248,8 @@ export default createEslintRule<[ } else if (vitestFnCall?.type !== 'expect') { return - } else if (vitestFnCall.modifiers.some(mod => mod.type === AST_NODE_TYPES.Identifier && mod.name == "to")) { + } + else if (vitestFnCall.modifiers.some(mod => mod.type === AST_NODE_TYPES.Identifier && mod.name == 'to')) { return } diff --git a/src/utils/parse-vitest-fn-call.ts b/src/utils/parse-vitest-fn-call.ts index 749244d..80f74c5 100644 --- a/src/utils/parse-vitest-fn-call.ts +++ b/src/utils/parse-vitest-fn-call.ts @@ -172,7 +172,8 @@ const findModifiersAndMatcher = ( && firstModifier !== ModifierName.to ) return 'modifier-unknown' - } else { + } + else { return 'modifier-unknown' } modifiers.push(member) @@ -542,5 +543,5 @@ const isTypeCastExpression = ( export const followTypeAssertionChain = ( expression: MaybeTypeCast ): Expression => isTypeCastExpression(expression) - ? followTypeAssertionChain(expression.expression) - : expression + ? followTypeAssertionChain(expression.expression) + : expression