mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
fc83ec724438dc7cc1bfed9a1ed205def5b9c53f
Eslint rules should never throw, so if we fail to parse with Babel or
Hermes, we should just ignore the error. This should fix issues such as
trying to run the eslint rule on non tsx|ts|jsx|js files, Hermes parser
not supporting certain JS syntax, etc.
I didn't add a test for this as our eslint-rule-tester config uses
hermes-eslint parser, so it wasn't possible to add a top level await as
it would crash hermes-eslint before our rule was triggered. Similarly I
couldn't add a test for non-JS files as it would not be parseable by
hermes-eslint.
Fixes #29107
ghstack-source-id: 60afcdb89a
Pull Request resolved: https://github.com/facebook/react/pull/29631
DiffTrain build for commit https://github.com/facebook/react/commit/113c8e7f72bcf5d3bc285546da1508b45da3cf53.
react-fbsource-import
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%