avoid-preserve-whitespace-false
Avoid setting preserveWhitespace
in Angular @Component
annotations to false explicitly. Its default value is already false.
Example
❌ Bad:
(
selector: 'component-selector',
templateUrl: 'component.html',
styleUrls: ['component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespace: false, // LINT: Avoid using preserveWhitespace: false.
directives: <Object>[
coreDirectives,
],
)
class Component {
}
✅ Good:
(
selector: 'component-selector',
templateUrl: 'component.html',
styleUrls: ['component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
directives: <Object>[
coreDirectives,
],
)
class Component {
}