From b34b750729bcbcfd80f72f82f46da5bc3e72158f Mon Sep 17 00:00:00 2001 From: Mofei Zhang Date: Tue, 23 Jul 2024 14:17:57 -0400 Subject: [PATCH] [compiler][eslint] remove compilationMode override; report bailouts on first line ghstack-source-id: 1870c7aa09d455bea89171b77468baeef5b3a63b Pull Request resolved: https://github.com/facebook/react/pull/30423 --- .../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 32f6ca141eaab..359db08cd7085 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, }); }