-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
TypeScript: type assertions (as) aren't wrapped #6443
Copy link
Copy link
Open
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)
Description
Prettier 1.18.2
Playground link
--parser typescriptInput:
const bifornCringerMoshedPerplexSawder =
askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie;
averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol =
annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave;
averredBathersBoxroomBuggyNurl = {
anodyneCondosMalateOverateRetinol:
annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave
};
averredBathersBoxroomBuggyNurl(
anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as
kochabCooieGameOnOboleUnweave
);Output:
const bifornCringerMoshedPerplexSawder = askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie;
averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol = annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave;
averredBathersBoxroomBuggyNurl = {
anodyneCondosMalateOverateRetinol: annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave
};
averredBathersBoxroomBuggyNurl(
anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave
);Expected behavior:
See input.
Note that as, if wrapped, should stay at the end of the line. This is not valid TS:
const bifornCringerMoshedPerplexSawder = askTrovenaBeenaDependsRowans
as glimseGlyphsHazardNoopsTieTie;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)