PrettierをつかってコードのフォーマットをしていたがPrettierのバージョンを2.xにあげたところArrow関数の引数が1つでも括弧がつくようになった
v1.0
a => {}
v2.0
(a) => {}
https://github.com/prettier/prettier/pull/7430
引数が増えた時に余計な変更をしなくて済むというのが利点
どちらでもよいのだが、変更されるファイル数が多いので一旦オプションでoffにする
- "always" - Always include parens. Example: (x) => x
- "avoid" - Omit parens when possible. Example: x => x
.prettierrc
{ ... "arrowParens": avoid, }
https://prettier.io/docs/en/options.html#arrow-function-parentheses