From 686b47799e82862bc79cc72c86b2983de9759631 Mon Sep 17 00:00:00 2001 From: Mofei Zhang Date: Mon, 22 Jul 2024 16:35:29 -0400 Subject: [PATCH] [compiler][eslint] remove compilationMode override; report bailouts on first line [ghstack-poisoned] --- .../src/rules/ReactCompilerRule.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts b/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts index a407748898be8..add78d3f804e0 100644 --- a/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts +++ b/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts @@ -100,7 +100,6 @@ function makeSuggestions( const COMPILER_OPTIONS: Partial = { noEmit: true, - compilationMode: "infer", panicThreshold: "none", }; @@ -161,9 +160,16 @@ const rule: Rule.RuleModule = { detail.loc != null && typeof detail.loc !== "symbol" ? ` (@:${detail.loc.start.line}:${detail.loc.start.column})` : ""; + const firstLineLoc = { + start: event.fnLoc.start, + end: { + line: event.fnLoc.start.line, + column: 10e3, + }, + }; context.report({ message: `[ReactCompilerBailout] ${detail.reason}${locStr}`, - loc: event.fnLoc, + loc: firstLineLoc, suggest, }); }