@ws-frontend/eslint-plugin-angular
Version:
WS Frontend Angular ESLint Rules
50 lines (37 loc) • 1.38 kB
Markdown
# Components
## Decorate input and output properties
Do use the class decorators instead of the inputs and outputs properties of the and metadata:
Consider placing or on the same line as the property it decorates.
Why? It is easier and more readable to identify which properties in a class are inputs or outputs.
Why? If you ever need to rename the property or event name associated with or , you can modify it in a single place.
Why? The metadata declaration attached to the directive is shorter and thus more readable.
Why? Placing the decorator on the same line usually makes for shorter code and still easily identifies the property as an input or output. Put it on the line above when doing so is clearly more readable.
Examples of **incorrect** code for this rule:
```ts
/* avoid */
export class HeroButtonComponent {
heroChange = new EventEmitter<any>();
label: string;
}
```
Examples of **correct** code for this rule:
```ts
export class HeroButtonComponent {
heroChange = new EventEmitter<any>();
label: string;
}
```
and