Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
babel-preset-proposal-typescript
Advanced tools
Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.
Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.
So that you can use babel to transform proposals which are current in stage 0-2 and TypeScript team will not implement them temporarily.
# yarn
yarn add -D babel-preset-proposal-typescript
# npm
npm i -D babel-preset-proposal-typescript
option | description | defaults |
---|---|---|
decoratorsBeforeExport | See Babel Document | undefined |
decoratorsLegacy | Whether to use legacy decorators semantic | true |
importDefer | Whether to enabled import-defer plugin, if true transform-modules-commonjs will be enabled automatically | false |
isTSX | Whether to enable jsx plugin with typescript | false , but true for /\.[jt]sx$/ |
optionalChainingAssignVersion | Version for optional-chaining-assign plugin, only '2023-07' allowed for now | '2023-07' |
pipelineOperator | Implementation of pipeline operator, minimal , smart or fsharp | minimal |
recordTuplePolyfill | Whether to enable import record-tuple plugin and polyfill, or specific the polyfill module name | true for Node>=14.6, it represents @bloomberg/record-tuple-polyfill |
recordTupleSyntaxType | record-tuple syntax, hash or bar | hash |
Note that unlike plugins, the presets are applied in an order of last to first (https://babeljs.io/docs/en/presets/#preset-ordering), so please make sure proposal-typescript
is used at the last.
.babelrc
(Recommended).babelrc
{
"presets": ["proposal-typescript"]
}
babel input.ts --presets proposal-typescript > output.ts
require('@babel/core').transform('code', {
presets: ['proposal-typescript'],
})
Pipe codes through babel-loader
.
loader = {
test: /\.[jt]sx?$/,
loader: 'babel-loader',
options: {
presets: ['@babel/typescript', 'proposal-typescript'],
},
}
// if you prefer `ts-loader` or `awesome-typescript-loader`
loader = {
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
},
{
loader: 'babel-loader',
options: {
presets: ['proposal-typescript'],
},
},
],
}
1stG | RxTS | UnTS |
---|---|---|
1stG | RxTS | UnTS |
---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.
FAQs
Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.
The npm package babel-preset-proposal-typescript receives a total of 23 weekly downloads. As such, babel-preset-proposal-typescript popularity was classified as not popular.
We found that babel-preset-proposal-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.