
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
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-brace-style
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 323 weekly downloads. As such, prettier-plugin-space-before-function-paren popularity was classified as not 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.