Skip to content

Commit 77cd24d

Browse files
committed
feat(eslint-plugin-template)!: add prefer-control-flow to recommended config
1 parent 46dd4ee commit 77cd24d

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

packages/angular-eslint/src/configs/template-recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default (
1919
'@angular-eslint/template/banana-in-box': 'error',
2020
'@angular-eslint/template/eqeqeq': 'error',
2121
'@angular-eslint/template/no-negated-async': 'error',
22+
'@angular-eslint/template/prefer-control-flow': 'error',
2223
},
2324
},
2425
];

packages/eslint-plugin-template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Please see https://github.com/angular-eslint/angular-eslint for full usage instr
6767
| [`prefer-at-empty`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-at-empty.md) | Prefer using `@empty` with `@for` loops instead of a separate `@if` or `@else` block to reduce code and make it easier to read. | | :wrench: | | |
6868
| [`prefer-built-in-pipes`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-built-in-pipes.md) | Encourages the use of Angular built-in pipes (e.g. lowercase, uppercase, titlecase) instead of certain JavaScript methods in Angular templates. | | | | |
6969
| [`prefer-contextual-for-variables`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-contextual-for-variables.md) | Ensures that contextual variables are used in @for blocks where possible instead of aliasing them. | | :wrench: | | |
70-
| [`prefer-control-flow`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-control-flow.md) | Ensures that the built-in control flow is used. | | | | |
70+
| [`prefer-control-flow`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-control-flow.md) | Ensures that the built-in control flow is used. | :white_check_mark: | | | |
7171
| [`prefer-ngsrc`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-ngsrc.md) | Ensures ngSrc is used instead of src for img elements | | | :bulb: | |
7272
| [`prefer-template-literal`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/prefer-template-literal.md) | Ensure that template literals are used instead of concatenating strings or expressions. | | :wrench: | | |
7373
| [`role-has-required-aria`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/role-has-required-aria.md) | [Accessibility] Ensures elements with ARIA roles have all required properties for that role. | | | :bulb: | :accessibility: |

packages/eslint-plugin-template/src/configs/recommended.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"rules": {
55
"@angular-eslint/template/banana-in-box": "error",
66
"@angular-eslint/template/eqeqeq": "error",
7-
"@angular-eslint/template/no-negated-async": "error"
7+
"@angular-eslint/template/no-negated-async": "error",
8+
"@angular-eslint/template/prefer-control-flow": "error"
89
}
910
}

packages/eslint-plugin-template/src/rules/prefer-control-flow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default createESLintRule<Options, MessageIds>({
1212
type: 'suggestion',
1313
docs: {
1414
description: 'Ensures that the built-in control flow is used.',
15+
recommended: 'recommended',
1516
},
1617
schema: [],
1718
messages: {

0 commit comments

Comments
 (0)