Skip to content

Commit 3a4c96b

Browse files
jtkieselclementdessoude
authored andcommitted
fix: add es5 as trailingComma option
1 parent 4c8f927 commit 3a4c96b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/prettier-plugin-java/src/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export default {
249249
type: "choice",
250250
category: "Java",
251251
default: "all",
252-
choices: ["all", "none"],
252+
choices: ["all", "es5", "none"],
253253
description: "Print trailing commas wherever possible when multi-line."
254254
}
255255
};

website/src/pages/playground/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ interface State {
1717
}
1818

1919
enum TrailingComma {
20-
None = "none",
21-
All = "all"
20+
All = "all",
21+
Es5 = "es5",
22+
None = "none"
2223
}
2324

2425
const codeSample = `public interface MyInterface {
@@ -144,8 +145,9 @@ function Inner() {
144145
setTrailingComma(event.target.value as TrailingComma)
145146
}
146147
>
147-
<option>all</option>
148-
<option>none</option>
148+
{Object.values(TrailingComma).map(option => (
149+
<option>{option}</option>
150+
))}
149151
</select>
150152
</label>
151153
</details>

0 commit comments

Comments
 (0)