[compiler][eslint] remove compilationMode override; report bailouts on first line
ghstack-source-id: 1870c7aa09d455bea89171b77468baeef5b3a63b Pull Request resolved: https://github.com/facebook/react/pull/30423
Mofei Zhang committed
Jul 23, 2024 at 14:17 UTC
b34b750729bcbcfd80f72f82f46da5bc3e72158f
1 file changed
+8
-2
compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts
+8
-2
@@ -100,7 +100,6 @@ function makeSuggestions(
100
101
const COMPILER_OPTIONS: Partial<PluginOptions> = {
102
noEmit: true,
103
- compilationMode: 'infer',
103
panicThreshold: 'none',
104
};
105
@@ -161,9 +160,16 @@ const rule: Rule.RuleModule = {
160
detail.loc != null && typeof detail.loc !== 'symbol'
161
? ` (@:${detail.loc.start.line}:${detail.loc.start.column})`
162
: '';
163
+ const firstLineLoc = {
164
+ start: event.fnLoc.start,
165
+ end: {
166
+ line: event.fnLoc.start.line,
167
+ column: 10e3,
168
+ },
169
+ };
170
context.report({
171
message: `[ReactCompilerBailout] ${detail.reason}${locStr}`,
166
- loc: event.fnLoc,
172
+ loc: firstLineLoc,
173
suggest,
174
});
175
}