-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
lang: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.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencystatus:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!
Description
Prettier 1.12.1
Playground link
--parser typescript
Input:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'be-list',
templateUrl: './be-list.component.html'
})
interface MyInterface {
id: string;
}
export class BeListComponent implements OnInit {
constructor() {
}
ngOnInit() {
this.title = 'Title';
}
}
Output:
import { Component, OnInit } from "@angular/core";
interface MyInterface {
id: string;
}
export class BeListComponent implements OnInit {
constructor() {}
ngOnInit() {
this.title = "Title";
}
}
Expected behavior:
While the decorator is invalid, It should not be deleted. Either format it or throw a syntax error.
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'be-list',
templateUrl: './be-list.component.html'
})
interface MyInterface {
id: string;
}
export class BeListComponent implements OnInit {
constructor() {
}
ngOnInit() {
this.title = 'Title';
}
}
Metadata
Metadata
Assignees
Labels
lang: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.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencystatus:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!