Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d84592

Browse filesBrowse files
committed
feat(eslint-plugin)!: formally deprecate [no-conflicting-lifecycle] and remove from "all" config
1 parent e0a01ff commit 5d84592
Copy full SHA for 5d84592

7 files changed

+27-12Lines changed: 27 additions & 12 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/angular-eslint/src/configs/ts-all.ts‎

Copy file name to clipboardExpand all lines: packages/angular-eslint/src/configs/ts-all.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default (
2626
'@angular-eslint/directive-selector': 'error',
2727
'@angular-eslint/no-async-lifecycle-method': 'error',
2828
'@angular-eslint/no-attribute-decorator': 'error',
29-
'@angular-eslint/no-conflicting-lifecycle': 'error',
3029
'@angular-eslint/no-developer-preview': 'error',
3130
'@angular-eslint/no-duplicates-in-metadata-arrays': 'error',
3231
'@angular-eslint/no-empty-lifecycle-method': 'error',
Collapse file

‎packages/eslint-plugin/README.md‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin/README.md
+8-1Lines changed: 8 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Please see https://github.com/angular-eslint/angular-eslint for full usage instr
5252
| [`contextual-decorator`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/contextual-decorator.md) | Ensures that classes use contextual decorators in their body | | | |
5353
| [`directive-class-suffix`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/directive-class-suffix.md) | Classes decorated with @Directive must have suffix "Directive" (or custom) in their name. Note: As of v20, this is no longer recommended by the Angular Team. | | | |
5454
| [`directive-selector`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/directive-selector.md) | Directive selectors should follow given naming rules. See more at https://angular.dev/style-guide#choosing-directive-selectors. | | | |
55-
| [`no-conflicting-lifecycle`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md) | Ensures that directives do not implement conflicting lifecycle interfaces. | | | |
5655
| [`no-duplicates-in-metadata-arrays`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-duplicates-in-metadata-arrays.md) | Ensures that metadata arrays do not contain duplicate entries. | | | |
5756
| [`no-empty-lifecycle-method`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-empty-lifecycle-method.md) | Disallows declaring empty lifecycle methods | :white_check_mark: | | :bulb: |
5857
| [`no-forward-ref`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-forward-ref.md) | Disallows usage of `forwardRef` references for DI | | | |
@@ -94,4 +93,12 @@ Please see https://github.com/angular-eslint/angular-eslint for full usage instr
9493

9594
<!-- begin deprecated rule list -->
9695

96+
### Deprecated
97+
98+
<!-- prettier-ignore-start -->
99+
| Rule | Replaced by |
100+
| --- | --- |
101+
| [`no-conflicting-lifecycle`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md) | |
102+
<!-- prettier-ignore-end -->
103+
97104
<!-- end deprecated rule list -->
Collapse file

‎packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
# `@angular-eslint/no-conflicting-lifecycle`
1717

18+
## ⚠️ THIS RULE IS DEPRECATED
19+
20+
---
21+
1822
Ensures that directives do not implement conflicting lifecycle interfaces.
1923

2024
- Type: suggestion
Collapse file

‎packages/eslint-plugin/src/configs/all.json‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin/src/configs/all.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"@angular-eslint/directive-selector": "error",
1313
"@angular-eslint/no-async-lifecycle-method": "error",
1414
"@angular-eslint/no-attribute-decorator": "error",
15-
"@angular-eslint/no-conflicting-lifecycle": "error",
1615
"@angular-eslint/no-developer-preview": "error",
1716
"@angular-eslint/no-duplicates-in-metadata-arrays": "error",
1817
"@angular-eslint/no-empty-lifecycle-method": "error",
Collapse file

‎packages/eslint-plugin/src/rules/no-conflicting-lifecycle.ts‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin/src/rules/no-conflicting-lifecycle.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default createESLintRule<Options, MessageIds>({
2222
name: RULE_NAME,
2323
meta: {
2424
type: 'suggestion',
25+
deprecated: true,
2526
docs: {
2627
description:
2728
'Ensures that directives do not implement conflicting lifecycle interfaces.',
Collapse file

‎packages/eslint-plugin/tests/configs.spec.ts‎

Copy file name to clipboardExpand all lines: packages/eslint-plugin/tests/configs.spec.ts
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from 'vitest';
1+
import { describe, expect, it } from 'vitest';
22
import eslintPlugin from '../src';
33

44
const ESLINT_PLUGIN_PREFIX = '@angular-eslint/';
@@ -17,6 +17,9 @@ function containsRule(config: Config, ruleName: string): boolean {
1717
);
1818
}
1919

20+
// TODO: remove in v22
21+
const hiddenRules = ['no-conflicting-lifecycle'];
22+
2023
describe('configs', () => {
2124
describe('recommended', () => {
2225
it('exists', () => {
@@ -27,9 +30,11 @@ describe('configs', () => {
2730
describe('all', () => {
2831
it('should contain all of the rules from the plugin', () => {
2932
expect(
30-
Object.keys(eslintPlugin.rules).every((ruleName) =>
31-
containsRule(eslintPlugin.configs.all, ruleName),
32-
),
33+
Object.keys(eslintPlugin.rules)
34+
.filter((ruleName) => !hiddenRules.includes(ruleName))
35+
.every((ruleName) =>
36+
containsRule(eslintPlugin.configs.all, ruleName),
37+
),
3338
).toBe(true);
3439
});
3540

Collapse file

‎tools/scripts/generate-configs.ts‎

Copy file name to clipboardExpand all lines: tools/scripts/generate-configs.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ async function tsPluginAll() {
189189
(config, entry) =>
190190
reducer('@angular-eslint/', config, entry, {
191191
errorLevel: 'error',
192-
filterDeprecated: false,
192+
filterDeprecated: true,
193193
}),
194194
{},
195195
),
@@ -243,7 +243,7 @@ async function tsPluginRecommended() {
243243
.reduce<LinterConfigRules>(
244244
(config, entry) =>
245245
reducer('@angular-eslint/', config, entry, {
246-
filterDeprecated: false,
246+
filterDeprecated: true,
247247
filterRequiresTypeChecking: 'exclude',
248248
}),
249249
{},
@@ -303,7 +303,7 @@ async function templatePluginAll() {
303303
(config, entry) =>
304304
reducer('@angular-eslint/template/', config, entry, {
305305
errorLevel: 'error',
306-
filterDeprecated: false,
306+
filterDeprecated: true,
307307
}),
308308
{},
309309
);
@@ -355,7 +355,7 @@ async function templatePluginRecommended() {
355355
.reduce<LinterConfigRules>(
356356
(config, entry) =>
357357
reducer('@angular-eslint/template/', config, entry, {
358-
filterDeprecated: false,
358+
filterDeprecated: true,
359359
filterRequiresTypeChecking: 'exclude',
360360
}),
361361
{},
@@ -411,7 +411,7 @@ async function templatePluginAccessibility() {
411411
.reduce<LinterConfigRules>(
412412
(config, entry) =>
413413
reducer('@angular-eslint/template/', config, entry, {
414-
filterDeprecated: false,
414+
filterDeprecated: true,
415415
errorLevel: 'error',
416416
filterRequiresTypeChecking: 'exclude',
417417
}),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.