You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Numeric separators (e.g. 10_000_000) are supported in TypeScript since version 2.7. It's still an ES (stage 3) proposal, therefore it doesn't get transpiled by Babel. So you get errors like the following.
./src/FrontEnd/App.tsx
SyntaxError: ....\App.tsx: Identifier directly after number (17:14)
15 | import { reduxStore } from "./ReduxStore";
16 |
> 17 | console.log(10_000_000);
Describe the bug
Numeric separators (e.g.
10_000_000
) are supported in TypeScript since version 2.7. It's still an ES (stage 3) proposal, therefore it doesn't get transpiled by Babel. So you get errors like the following.Steps to reproduce
See above.
Expected behavior
No transpile error.
Actual behavior
See above.
Reproducible demo
In any .ts/.tsx file:
Solution
Add the "@babel/plugin-proposal-numeric-separator" plugin to the Babel preset if TypeScript is enabled. (Just like we do it for decorators.)
The text was updated successfully, but these errors were encountered: