Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [sort-ngmodule-metadata-arrays] deprecate rule #1781

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/eslint-plugin/README.md
Expand Up @@ -67,7 +67,6 @@
| [`prefer-standalone`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone.md) | Ensures component, directive and pipe `standalone` property is set to `true` in the component decorator | | :wrench: | |
| [`relative-url-prefix`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/relative-url-prefix.md) | The ./ and ../ prefix is standard syntax for relative URLs; don't depend on Angular's current ability to do without that prefix. See more at https://angular.io/styleguide#style-05-04 | | | |
| [`require-localize-metadata`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/require-localize-metadata.md) | Ensures that $localize tagged messages contain helpful metadata to aid with translations. | | | |
| [`sort-ngmodule-metadata-arrays`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/sort-ngmodule-metadata-arrays.md) | Ensures ASC alphabetical order for `NgModule` metadata arrays for easy visual scanning | | :wrench: | |
| [`use-component-selector`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-component-selector.md) | Component selector must be declared | | | |
| [`use-component-view-encapsulation`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-component-view-encapsulation.md) | Disallows using `ViewEncapsulation.None` | | | :bulb: |
| [`use-injectable-provided-in`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-injectable-provided-in.md) | Using the `providedIn` property makes `Injectables` tree-shakable | | | :bulb: |
Expand All @@ -89,6 +88,7 @@
| Rule | Replaced by |
| --- | --- |
| [`prefer-standalone-component`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone-component.md) | [`prefer-standalone`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone.md) |
| [`sort-ngmodule-metadata-arrays`](https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/sort-ngmodule-metadata-arrays.md) | |
<!-- prettier-ignore-end -->

<!-- end deprecated rule list -->
Expand Up @@ -15,6 +15,10 @@

# `@angular-eslint/sort-ngmodule-metadata-arrays`

## ⚠️ THIS RULE IS DEPRECATED

---

Ensures ASC alphabetical order for `NgModule` metadata arrays for easy visual scanning

- Type: suggestion
Expand Down
Expand Up @@ -16,6 +16,7 @@ export default createESLintRule<Options, MessageIds>({
name: RULE_NAME,
meta: {
type: 'suggestion',
deprecated: true,
docs: {
description:
'Ensures ASC alphabetical order for `NgModule` metadata arrays for easy visual scanning',
Expand Down
20 changes: 12 additions & 8 deletions tools/scripts/generate-rule-docs.ts
Expand Up @@ -111,14 +111,18 @@ const testDirs = readdirSync(testDirsDir);

${
deprecated
? `## ⚠️ THIS RULE IS DEPRECATED\n\nPlease use ${(replacedBy || [])
.map(
(r: string) =>
`\`@angular-eslint/${
plugin === 'eslint-plugin-template' ? 'template/' : ''
}${r}\``,
)
.join(', ')} instead.\n\n---\n\n`
? `## ⚠️ THIS RULE IS DEPRECATED\n\n${
replacedBy
? `Please use ${(replacedBy || [])
.map(
(r: string) =>
`\`@angular-eslint/${
plugin === 'eslint-plugin-template' ? 'template/' : ''
}${r}\``,
)
.join(', ')} instead.`
: ''
}\n\n---\n\n`
: ''
}${description}

Expand Down