Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Newbie012 committed Dec 14, 2022
1 parent 594217e commit c86f6a1
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -185,7 +185,6 @@ function runCheckOnNode(params: {
node: callNode,
messageId: 'preferObjectSyntax',
fix(fixer) {
const ruleFixes: TSESLint.RuleFix[] = []
const optionsObjectProperties: string[] = []

// queryKey
Expand Down Expand Up @@ -219,12 +218,10 @@ function runCheckOnNode(params: {
if (callNode.callee.type === AST_NODE_TYPES.Identifier) {
const argsText = `{ ${optionsObjectProperties.join(', ')} }`

ruleFixes.push(
fixer.replaceText(callNode, `${callNode.callee.name}(${argsText})`),
)
return fixer.replaceText(callNode, `${callNode.callee.name}(${argsText})`);
}

return ruleFixes
return null;
},
})
}

0 comments on commit c86f6a1

Please sign in to comment.