Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7329
Closed
Open
Issue created Jul 05, 2019 by Administrator@rootContributor

TypeScript: Support numeric separators

Created by: ulrichb

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.

./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);

Steps to reproduce

See above.

Expected behavior

No transpile error.

Actual behavior

See above.

Reproducible demo

In any .ts/.tsx file:

console.log(10_000_000);

Solution

Add the "@babel/plugin-proposal-numeric-separator" plugin to the Babel preset if TypeScript is enabled. (Just like we do it for decorators.)

Assignee
Assign to
Time tracking