-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Keep multiple property and argument decorators on same line as argument when possible (Babylon, TypeScript) #1974
Copy link
Copy link
Closed
Labels
lang:javascriptIssues affecting JSIssues affecting JSlang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.10.2
Playground link
--parser typescriptInput:
export class CoreModule {
@Input() @Output() prop: string;
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {}
}Output:
export class CoreModule {
@Input()
@Output()
prop: string;
constructor(
@Optional()
@SkipSelf()
parentModule: CoreModule
) {}
}Expected output:
No difference between input and output.
If we did the same thing with only one decorator, the result would be:
export class CoreModule {
@Input() prop: string;
constructor(@Optional() parentModule: CoreModule) {}
}In this sense I don't think breaking on multiple decorators adds any value, instead adds more visual noise and makes it harder to spot arguments in e.g. the constructor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.