From ffda1312b12dedf8805aa1d78c006ac6b63c30e6 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Wed, 29 May 2024 12:36:11 +0900 Subject: [PATCH] Update [ghstack-poisoned] --- .../src/rules/ReactCompilerRule.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 fd33ae0339a1d..7c46cf0b88458 100644 --- a/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts +++ b/compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts @@ -124,12 +124,14 @@ const rule: Rule.RuleModule = { }); } catch {} } else { - babelAST = HermesParser.parse(sourceCode, { - babel: true, - enableExperimentalComponentSyntax: true, - sourceFilename: filename, - sourceType: "module", - }); + try { + babelAST = HermesParser.parse(sourceCode, { + babel: true, + enableExperimentalComponentSyntax: true, + sourceFilename: filename, + sourceType: "module", + }); + } catch {} } if (babelAST != null) {