
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
prettier-plugin-space-before-function-paren
Advanced tools
A prettier plugin to add a space before function parentheses for function definitions (but not function calls) in JS. **Requires Prettier 3.0.0 or later.**
A prettier plugin to add a space before function parentheses for function definitions (but not function calls) in JS. Requires Prettier 3.0.0 or later.
npm install -D prettier prettier-plugin-space-before-function-paren
There are no config options for this plugin. All you need to do is actually include it in your Prettier config:
{
"plugins": ["prettier-plugin-space-before-function-paren"]
}
function test(a, b) {
return a + b;
}
becomes:
function test (a, b) {
return a + b;
}
async function test(a, b) {
return a + b;
}
becomes:
async function test (a, b) {
return a + b;
}
class Foo {
method(a, b) {
return a + b;
}
}
becomes:
class Foo {
method (a, b) {
return a + b;
}
}
class Foo {
async method(a, b) {
return a + b;
}
}
becomes:
class Foo {
async method (a, b) {
return a + b;
}
}
class Foo {
static method(a, b) {
return a + b;
}
}
becomes:
class Foo {
static method (a, b) {
return a + b;
}
}
class Foo {
get foo() {
return true;
}
}
becomes:
class Foo {
get foo () {
return true;
}
}
class Foo {
set foo(value) {
this._foo = value;
}
}
becomes:
class Foo {
set foo (value) {
this._foo = value;
}
}
function* test() {
yield 1;
}
becomes:
function* test () {
yield 1;
}
test(1, 2);
becomes:
test(1, 2);
const add = (a, b) => a + b;
becomes:
const add = (a, b) => a + b;
Prettier already handles this case.
const add = function(a, b) {
return a + b;
};
becomes:
const add = function (a, b) {
return a + b;
};
Current version is a proof of concept, please try it out and give feedback!
FAQs
A prettier plugin to add a space before function parentheses for function definitions (but not function calls) in JS and TS. **Requires Prettier 3.0.0 or later.**
The npm package prettier-plugin-space-before-function-paren receives a total of 1,231 weekly downloads. As such, prettier-plugin-space-before-function-paren popularity was classified as popular.
We found that prettier-plugin-space-before-function-paren 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
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Google’s UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.