Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
babel-preset-proposals
Advanced tools
A Babel 7 preset to manage experimental proposal plugin dependencies and usage, providing default configuration for plugins which have mandatory options, and ensuring that proposal plugins which affect one another are used in the correct order and have appropriate options set.
npm install babel-preset-proposals
absolutePaths
boolean
, defaults to false
.
Use absolute paths in plugins
config - use this option if you're creating a Babel configuration which will be used outside of the module resolution scope of where you're generating it.
all
boolean
, defaults to false
.
Enable all plugins which haven't been otherwise configured.
loose
boolean
Sets the loose
option for all plugins which are enabled and have a loose
option - primarily intended for flipping plugin loose
options to true
, since they default to false
.
boolean
or an Object
, defaults to false
.
To enable a plugin, pass its option as true
:
{
"presets": [
["babel-preset-proposals", {
"classProperties": true,
"decorators": true,
"exportDefaultFrom": true,
"exportNamespaceFrom": true
}]
]
}
If the plugin takes options, you can pass an options Object for it.
{
"presets": [
["babel-preset-proposals", {
"decorators": {"legacy": true}
}]
]
}
Preset option | Babel Plugin Docs |
---|---|
functionBind | @babel/plugin-proposal-function-bind |
exportDefaultFrom | @babel/plugin-proposal-export-default-from |
logicalAssignmentOperators | @babel/plugin-proposal-logical-assignment-operators |
pipelineOperator | @babel/plugin-proposal-pipeline-operator |
doExpressions | @babel/plugin-proposal-do-expressions |
decorators | @babel/plugin-proposal-decorators |
functionSent | @babel/plugin-proposal-function-sent |
exportNamespaceFrom | @babel/plugin-proposal-export-namespace-from |
numericSeparator | @babel/plugin-proposal-numeric-separator |
throwExpressions | @babel/plugin-proposal-throw-expressions |
dynamicImport | @babel/plugin-syntax-dynamic-import |
importMeta | @babel/plugin-syntax-import-meta |
classStaticBlock | @babel/plugin-proposal-class-static-block |
classProperties | @babel/plugin-proposal-class-properties |
If a plugin requires configuration and you enable it with a true
option, this preset will provide default options:
Preset option | Default plugin options |
---|---|
decorators | {decoratorsBeforeExport: false} (as per this decision in the proposal repo) |
pipelineOperator | {proposal: 'minimal'} |
validateOptions(options?: Object): String[]
The validation this plugin performs on its options is exported if you need to use it in tooling which accepts user configuration, as you may want to report option validation issues yourself rather than letting Babel blow up.
It returns an Array of error messages, which will be empty if options were valid.
Proposal plugins will never be stable, so this package will always be at a 0.X version and will make breaking changes as necessary, so lock it to the specific 0.X version you're using.
FAQs
A Babel preset to manage use of proposal plugins
The npm package babel-preset-proposals receives a total of 1,826 weekly downloads. As such, babel-preset-proposals popularity was classified as popular.
We found that babel-preset-proposals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.