Skip to content

Commit ab7732e

Browse files
authored
Replace context.getSource with sourceCode.getText (#2174)
1 parent 980d98b commit ab7732e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: rules/prefer-modern-dom-apis.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ const checkForInsertAdjacentTextOrInsertAdjacentElement = (context, node) => {
5959
}
6060

6161
const preferredMethod = positionReplacers.get(position);
62-
const content = context.getSource(contentNode);
63-
const reference = context.getSource(node.callee.object);
62+
const {sourceCode} = context;
63+
const content = sourceCode.getText(contentNode);
64+
const reference = sourceCode.getText(node.callee.object);
6465

6566
const fix = method === 'insertAdjacentElement' && !isValueNotUsable(node)
6667
? undefined
@@ -77,7 +78,7 @@ const checkForInsertAdjacentTextOrInsertAdjacentElement = (context, node) => {
7778
reference,
7879
method,
7980
preferredMethod,
80-
position: context.getSource(positionNode),
81+
position: sourceCode.getText(positionNode),
8182
content,
8283
},
8384
fix,

0 commit comments

Comments
 (0)