TypeScript: Add trailing comma in tsx, only for arrow function (#6190 by @sosukesuzuki)
Prettier inserts a trailing comma to single type parameter for arrow functions in tsx, since v 1.18. But, this feature inserts a trailing comma to type parameter for besides arrow functions too (e.g, function , interface). This change fix it.
// Input
interface Interface1<T> {
one: "one";
}
function function1<T>() {
return "one";
}
// Output (Prettier stable)
interface Interface1<T,> {
one: "one";
}
function function1<T,>() {
return "one";
}
// Output (Prettier master)
interface Interface1<T> {
one: "one";
}
function function1<T>() {
return "one";
}
When using overrides
in the config file, Prettier was not matching dotfiles (files that start with .
). This was fixed in 1.18.1