Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(js_formatter): es5 trailing comma revision #848

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl FormatRule<TsTupleTypeElementList> for FormatTsTupleTypeElementList {
type Context = JsFormatContext;

fn fmt(&self, node: &TsTupleTypeElementList, f: &mut JsFormatter) -> FormatResult<()> {
let trailing_separator = FormatTrailingComma::All.trailing_separator(f.options());
let trailing_separator = FormatTrailingComma::ES5.trailing_separator(f.options());

f.join_with(&soft_line_break_or_space())
.entries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl FormatRule<TsTypeParameterList> for FormatTsTypeParameterList {
let trailing_separator = if node.len() == 1 && node.trailing_separator().is_some() {
TrailingSeparator::Mandatory
} else {
FormatTrailingComma::All.trailing_separator(f.options())
FormatTrailingComma::ES5.trailing_separator(f.options())
};

f.join_with(&soft_line_break_or_space())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ Bracket same line: false
class C<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
> {
one<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
adsadasdasdasdasdasdasdasdasdasdas1,
dsadsadasdasdasdasdasdasdasd2,
Expand All @@ -106,7 +106,7 @@ class C<
two<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
adsadasdasdasdasdasdasdasdasdasdas1,
dsadsadasdasdasdasdasdasdasd2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Bracket same line: false
function test<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
longlonglonglonglonglonglongItem1,
longlonglonglonglonglonglongItem2,
Expand All @@ -140,7 +140,7 @@ function test<
const test1 = <
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
longlonglonglonglonglonglongItem1,
longlonglonglonglonglonglongItem2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const obj = {
one<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
adsadasdasdasdasdasdasdasdasdasdas1,
dsadsadasdasdasdasdasdasdasd2,
Expand All @@ -109,7 +109,7 @@ const obj = {
two<
longlonglonglonglonglonglongT1,
longlonglonglonglonglonglongT2,
longlonglonglonglonglonglongT3
longlonglonglonglonglonglongT3,
>(
adsadasdasdasdasdasdasdasdasdasdas1,
dsadsadasdasdasdasdasdasdasd2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ Bracket same line: false
type A = [
adsadasdasdasdasdasdasdasdasdasdas,
dsadsadasdasdasdasdasdasdasd,
dsadsadasdasdasdasdasdasdasd
dsadsadasdasdasdasdasdasdasd,
];

interface C<
adsadasdasdasdasdasdasdasdasdasdas,
dsadsadasdasdasdasdasdasdasd,
dsadsadasdasdasdasdasdasdasd
dsadsadasdasdasdasdasdasdasd,
> {}
```

Expand Down