Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@babel/preset-stage-0
Advanced tools
As of v7.0.0-beta.55, we've removed Babel's Stage presets. Please consider reading our blog post on this decision for more details. TL;DR is that it's more beneficial in the long run to explicitly add which proposals to use.
For a more automatic migration, we have updated babel-upgrade to do this for you (you can run npx babel-upgrade
).
If you want the same configuration as before:
{
"plugins": [
// Stage 0
"@babel/plugin-proposal-function-bind",
// Stage 1
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
["@babel/plugin-proposal-optional-chaining", { "loose": false }],
["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }],
["@babel/plugin-proposal-nullish-coalescing-operator", { "loose": false }],
"@babel/plugin-proposal-do-expressions",
// Stage 2
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": true }],
"@babel/plugin-proposal-json-strings"
]
}
If you're using the same configuration across many separate projects, keep in mind that you can also create your own custom presets with whichever plugins and presets you're looking to use.
module.exports = function() {
return {
plugins: [
require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": true }],
],
presets: [
// ...
],
};
};
NOTE: Compatibility between @babel/plugin-proposal-class-properties
and @babel/plugin-proposal-decorators
If you are including your plugins manually and using @babel/plugin-proposal-class-properties
, make sure that @babel/plugin-proposal-decorators
comes before @babel/plugin-proposal-class-properties
.
When using the legacy: true
option of @babel/plugin-proposal-decorators
, @babel/plugin-proposal-class-properties
must be used in loose: true
mode.
If you are not using @babel/plugin-proposal-decorators
, loose
mode is not needed.
FAQs
Babel preset for stage 0 plugins
The npm package @babel/preset-stage-0 receives a total of 40,799 weekly downloads. As such, @babel/preset-stage-0 popularity was classified as popular.
We found that @babel/preset-stage-0 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.