dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Add "anonymous-only" value to "functionExpression.spaceBeforeParentheses" configuration

Open cameronhunter opened this issue 3 years ago • 1 comments

Currently functionExpression.spaceBeforeParentheses is a boolean configuration option. It would be great if this could be extended to allow further choice on treating anonymous function expressions differently to named function expressions.

Input Code

const namedFunctionExpression = function namedFunctionExpression() {
  return true;
};

const anonymousFunctionExpression = function() {
  return true;
};

Desired Output

const namedFunctionExpression = function namedFunctionExpression() {
  return true;
};

const anonymousFunctionExpression = function () {
  return true;
};

cameronhunter avatar Apr 27 '22 19:04 cameronhunter

You can already do this via "functionExpression.spaceAfterFunctionKeyword": true: Playground

jakebailey avatar Sep 09 '22 04:09 jakebailey