Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip plugin for non-Flow JS code (facebook#1556)
Summary: This is a mitigation for facebook#1549. Updates `babel-plugin-syntax-hermes-parser` to abort when the file contents do not include `flow`. **Context: React Native** Originally changed in facebook/react-native#46696, as our internal Flow support had diverged from `babel/plugin-syntax-flow` (facebook/react-native#46601). We effectively have three flavours of JavaScript in support: - Flow@latest for the `react-native` package, shipped as source — uses `hermes-parser`. - TypeScript for product code (community template, Expo) — uses `babel/plugin-syntax-typescript`. - Plain JavaScript/JSX in product code, *which may be extended with additional user Babel plugins and needs lenient parsing* — uses base `babel/parser` (**this change**). I'd love to simplify this 😅. Reviewed By: cipolleschi Differential Revision: D65272155
- Loading branch information