This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] support import/export type
ClosedPublic

Authored by jankuehle on May 8 2023, 6:41 AM.

Details

Summary

Users can choose to only import/export the type of the symbol (not value nor namespace) by adding a type keyword, e.g.:

import type {x} from 'y';
import {type x} from 'y';
export type {x};
export {type x};

Previously, this was not handled and would:

  • Terminate import sorting
  • Remove the space before the curly bracket in export type {

With this change, both formatting and import sorting work as expected.

Diff Detail

Event Timeline

jankuehle created this revision.May 8 2023, 6:41 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 8 2023, 6:41 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jankuehle requested review of this revision.May 8 2023, 6:41 AM
krasimir accepted this revision.May 9 2023, 3:06 AM
krasimir added a subscriber: krasimir.

Looks good! Thank you!

This revision is now accepted and ready to land.May 9 2023, 3:06 AM
MyDeveloperDay accepted this revision.May 9 2023, 10:41 PM
This revision was landed with ongoing or failed builds.May 10 2023, 6:28 AM
This revision was automatically updated to reflect the committed changes.