Skip to main content

avoid-preserve-whitespace-false

added in: 1.6.0
⚠️
Pro+

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 {
}