Skip to content

Commit

Permalink
fix(eslint-plugin-react-compiler): support v9 context api
Browse files Browse the repository at this point in the history
This change fixes a gap in the plugin's support of eslint v9.  In one place that it's using the SourceCode api, it's correctly considering v9's api.  But in the other place where SourceCode is used, it's only using the legacy api, which was removed in v9.
  • Loading branch information
michaelfaith committed Jan 11, 2025
1 parent 0bf1f39 commit 0642f2f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const rule: Rule.RuleModule = {
nodeLoc: BabelSourceLocation,
suppression: string,
): boolean {
const sourceCode = context.getSourceCode();
const sourceCode = context.sourceCode ?? context.getSourceCode();
const comments = sourceCode.getAllComments();
const flowSuppressionRegex = new RegExp(
'\\$FlowFixMe\\[' + suppression + '\\]',
Expand Down

0 comments on commit 0642f2f

Please sign in to comment.