Skip to content

Commit

Permalink
Replace context.getSource with sourceCode.getText (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Jul 11, 2023
1 parent 980d98b commit ab7732e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rules/prefer-modern-dom-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ const checkForInsertAdjacentTextOrInsertAdjacentElement = (context, node) => {
}

const preferredMethod = positionReplacers.get(position);
const content = context.getSource(contentNode);
const reference = context.getSource(node.callee.object);
const {sourceCode} = context;
const content = sourceCode.getText(contentNode);
const reference = sourceCode.getText(node.callee.object);

const fix = method === 'insertAdjacentElement' && !isValueNotUsable(node)
? undefined
Expand All @@ -77,7 +78,7 @@ const checkForInsertAdjacentTextOrInsertAdjacentElement = (context, node) => {
reference,
method,
preferredMethod,
position: context.getSource(positionNode),
position: sourceCode.getText(positionNode),
content,
},
fix,
Expand Down

0 comments on commit ab7732e

Please sign in to comment.