Skip to content

Commit

Permalink
fix(eslint-plugin-query): update deprecated getSourceCode() method (#…
Browse files Browse the repository at this point in the history
…8117)

* fix(eslint-plugin-query): update deprecated `getSourceCode()` method

* chore: add eslint-disable

---------

Co-authored-by: Dominik Dorfmeister <[email protected]>
  • Loading branch information
saul-atomrigs and TkDodo authored Oct 4, 2024
1 parent 05924f4 commit bb8278d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export const rule = createRule({
return
}

const nodeText = context.getSourceCode().getText(node)
// we need the fallbacks for backwards compat with eslint < 8.37.0
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
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 bb8278d

Please sign in to comment.