
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
babel-plugin-syntax-trailing-function-commas
Advanced tools
The babel-plugin-syntax-trailing-function-commas npm package allows Babel to parse trailing commas in function parameter lists and calls. This is particularly useful for improving the readability and maintainability of code by allowing developers to add new parameters without modifying the last line of the existing parameters.
Parsing trailing commas in function parameters
This feature enables the parsing of trailing commas in function parameter lists, which can help in minimizing diff outputs when new parameters are added.
function example(a, b, c,) {\n return a + b + c;\n}
Parsing trailing commas in function calls
This feature allows for trailing commas in function calls, aligning with the enhanced syntax capabilities for array and object literals.
example(1, 2, 3,);
Compile trailing function commas to ES5
$ npm install babel-plugin-syntax-trailing-function-commas
.babelrc
(Recommended).babelrc
{
"plugins": ["syntax-trailing-function-commas"]
}
$ babel --plugins syntax-trailing-function-commas script.js
require("babel-core").transform("code", {
plugins: ["syntax-trailing-function-commas"]
});
FAQs
Compile trailing function commas to ES5
The npm package babel-plugin-syntax-trailing-function-commas receives a total of 4,984,167 weekly downloads. As such, babel-plugin-syntax-trailing-function-commas popularity was classified as popular.
We found that babel-plugin-syntax-trailing-function-commas 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.