Skip to content

Commit

Permalink
fix(eslint-plugin-query): update deprecated getSourceCode() method
Browse files Browse the repository at this point in the history
  • Loading branch information
saul-atomrigs committed Oct 1, 2024
1 parent 55a6155 commit cadc9fc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export const rule = createRule({
return
}

const nodeText = context.getSourceCode().getText(node)
// we need the fallbacks for backwards compat with eslint < 8.37.0
const sourceCode = context.sourceCode ?? context.getSourceCode()
const nodeText = sourceCode.getText(node)
const variableName = parent.id.name

return (fixer: TSESLint.RuleFixer) => {
Expand Down

0 comments on commit cadc9fc

Please sign in to comment.