mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
372696c541015163c77a131f02f77a4591e023a4
Fbt + typescript [seems](https://github.com/facebook/fbt/issues/49) [to be](https://github.com/facebook/sfbt/issues/72) a non-blessed workflow. We do want to allow for both flow and typescript tests, so I followed some instructions [from a guide](https://dev.to/retyui/how-to-add-support-typescript-for-fbt-an-internationalization-framework-3lo0) to add support. - fbt tags desugar to.. "fbt" strings. By default, typescript removes unused imports at parse step (and on autoformat steps). We pass special babel-typescript configs and change vscode settings to mitigate this. - I tried adding `fbt` to the global scope, but the fbt transform asserts that `fbt` is actually imported in the source program. - Other hacks are available, like saying we'll only allow for fbt in flow files, or always patching the source code to have an "fbt" import. This seemed the most reasonable and easiest to debug / follow when writing tests
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%