Skip to content

Commit

Permalink
fix(eslint-plugin): [sort-ngmodule-metadata-arrays] deprecate rule (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
abaran30 committed May 1, 2024
1 parent a937df6 commit 76fb3f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
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

0 comments on commit 76fb3f1

Please sign in to comment.