Packages

@babel/preset-typescript

8.0.7 · 7 Oct 2026MIT79.9M / weekRepositoryHomepagenpmAtom feed

Your version

7.12.0

14 Oct 2020Where it was published

7.29.7 is the newest release of 7.x.

In short

13 new22 fixed11 changed7 internal

Release note

Thanks @akphi, @Amareis, @barronwei, @iamfotx, @mischnic, @overlookmotel, @ryanrhee, @snitin315, @sosukesuzuki, @timgates42, @zweimach for their first PRs.

:eyeglasses: Spec Compliance

  • babel-core, babel-helper-module-transforms, babel-parser, babel-plugin-proposal-export-namespace-from, babel-plugin-syntax-module-string-names, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-modules-umd, babel-types: String import/export specifier (@JLHwung)

  • babel-parser: [ts] Throw a syntax error for index signature with declare (@sosukesuzuki)

:rocket: New Feature

  • babel-core, babel-generator, babel-parser, babel-plugin-syntax-import-assertions, babel-plugin-syntax-module-attributes, babel-standalone, babel-types: Parse import-assertions (@xtuc)

  • babel-core, babel-helper-create-class-features-plugin, babel-helper-module-transforms, babel-helper-replace-supers, babel-plugin-proposal-class-static-block, babel-plugin-transform-modules-commonjs, babel-standalone, babel-traverse, babel-types: Transform class static block (@JLHwung)

  • babel-generator, babel-parser, babel-plugin-syntax-class-static-block, babel-types: Parse class static block (@JLHwung)

  • babel-generator, babel-parser, babel-types: Support TypeScript mapped type 'as' clauses (@existentialism)

  • babel-generator, babel-parser, babel-types: [ts] Add support for the "intrinsic" keyword (@nicolo-ribaudo)

  • babel-parser, babel-types: [ts] Add support for template interpolations in types (@nicolo-ribaudo)

  • babel-plugin-transform-modules-systemjs: SystemJS top-level await support (@guybedford)

  • babel-plugin-transform-typescript, babel-preset-typescript: Add jsxPragmaFrag support to typescript transform (@JLHwung)

  • babel-core, babel-helper-module-transforms, babel-parser, babel-plugin-proposal-export-namespace-from, babel-plugin-syntax-module-string-names, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-modules-umd, babel-types: String import/export specifier (@JLHwung)

  • babel-core: Return a list of files that were read from loadPartialConfig (@devongovett)

:bug: Bug Fix

  • babel-parser: [ts] Add asserts: false to TSTypePredicate node (@sosukesuzuki)

  • babel-parser: Move check for TSTypeCastExpression to catch another case (@existentialism)

  • babel-parser: Throw a recoverable error for missing initializer in const declaration (@sosukesuzuki)

  • babel-parser: Improve syntax error for class fields in ambient context (@sosukesuzuki)

  • babel-parser: Throw a syntax error for empty type parameter/argument (@sosukesuzuki)

  • babel-parser: Throw an error for a declare class field that have an initializer (@sosukesuzuki)

  • babel-parser: Do not throw an error for optional binding pattern params in function declaration (@sosukesuzuki)

  • babel-parser: Fix invalid setter parse (@fisker)

  • babel-parser: Throw a syntax error for a declare function with a body (@sosukesuzuki)

  • babel-parser: Throw a syntax error for a constructor with type parameters (@sosukesuzuki)

  • babel-plugin-transform-typescript: fix transform-typescript logic to remove definite fields (@akphi)

  • babel-plugin-transform-typescript: [transform-typescript] Fix import elision for type exports (@Amareis)

  • babel-helper-member-expression-to-functions, babel-plugin-proposal-class-properties, babel-plugin-proposal-nullish-coalescing-operator, babel-plugin-proposal-optional-chaining: Handle cases when ?? and ?. is in binding initializers (@JLHwung)

  • babel-helper-builder-react-jsx-experimental, babel-plugin-transform-react-jsx-development, babel-plugin-transform-react-jsx, babel-preset-react: add .js extension to react runtime for JSX transform (@lunaruan)

  • babel-traverse, babel-types: fix: mark Pattern in CatchClause as scope (@JLHwung)

  • babel-generator: Fix printing TSTypeOperator (@existentialism)

  • babel-generator: Ensure expressions wrapped in parens (@overlookmotel)

  • babel-generator: Fix @babel/generator does not print decorators of private properties (@zweimach)

  • babel-generator: Add sourcemap markings for each line of a string (@jridgewell)

  • babel-plugin-transform-modules-systemjs: Fix reexporting init-less variable in systemjs (@JLHwung)

  • babel-helper-module-transforms, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-umd, babel-plugin-transform-runtime: [cjs] Skip duplicate reexported bindings in namespace reexports (@mischnic)

  • babel-helper-create-regexp-features-plugin, babel-plugin-transform-unicode-regex: Bump regexpu-core (@existentialism)

  • babel-plugin-proposal-do-expressions, babel-traverse: fix(do-expr): SwitchStatement with IfStatement cases (@barronwei)

:nail_care: Polish

  • babel-parser: [parser] Better error message for missing number exponent (@iamfotx)

  • babel-parser: Throw a syntax error for a parameter properties in not constructor (@sosukesuzuki)

  • babel-helper-compilation-targets, babel-helper-validator-option, babel-preset-env: refactor: add @babel/helper-validator-option (@JLHwung)

:house: Internal

  • babel-cli, babel-helper-transform-fixture-test-runner, babel-traverse: Replace lodash 'defaults' usage with ES6 Spread initializer (@jayaddison)

  • babel-plugin-transform-runtime, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime: Specify runtime exports (@JLHwung)

  • babel-core: Instantiate presets before plugins (@nicolo-ribaudo)

  • babel-plugin-proposal-logical-assignment-operators, babel-plugin-proposal-numeric-separator, babel-plugin-syntax-import-meta, babel-plugin-syntax-logical-assignment-operators, babel-plugin-syntax-numeric-separator, babel-plugin-transform-modules-systemjs, babel-preset-env, babel-standalone: Archive plugins (@JLHwung)

  • Other

  • babel-compat-data, babel-preset-env: chore: bump electron-to-chromium (@JLHwung)

  • babel-parser: Add missing tests for TypeScript syntax errors (@sosukesuzuki)

  • babel-compat-data: chore: remove unused dependencies (@JLHwung)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.