Page MenuHomePhabricator

clang-format: [JS] do not collapse short classes.
ClosedPublic

Authored by mprobst on Nov 24 2017, 5:38 AM.

Details

Summary

clang-format does not collapse short records, interfaces, unions, etc.,
but fails to do so if the record is preceded by certain modifiers
(export, default, abstract, declare). This change skips over all
modifiers, and thus handles all record definitions uniformly.

Before:

export class Foo { bar: string; }
class Baz {
  bam: string;
}

After:

export class Foo {
  bar: string;
}
class Baz {
  bam: string;
}

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Nov 24 2017, 5:38 AM
djasper accepted this revision.Nov 24 2017, 8:40 AM

Looks good.

This revision is now accepted and ready to land.Nov 24 2017, 8:40 AM
This revision was automatically updated to reflect the committed changes.