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.
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"]
}Important
Due to Prettier limitations, to use this plugin with other plugins formatting JS/TS code, install the prettier-plugin-merge plugin and add it to the end of your plugins array. This plugin will be used last and preserve changes made by the previous plugins.
Current version is a proof of concept, please try it out and give feedback!