8000 docs(eslint-plugin): [sort-type-constituents] deprecate the rule (#9253) · c0sta/typescript-eslint@c6e9719 · GitHub
[go: up one dir, main page]

Skip to content

Commit c6e9719

Browse files
docs(eslint-plugin): [sort-type-constituents] deprecate the rule (typescript-eslint#9253)
* docs(eslint-plugin): [sort-type-constituents] deprecate the rule * fix: regenerate configs
1 parent 588bd53 commit c6e9719

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/eslint-plugin/docs/rules/sort-type-constituents.mdx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import TabItem from '@theme/TabItem';
99
>
1010
> See **https://typescript-eslint.io/rules/sort-type-constituents** for documentation.
1111
12+
:::danger Deprecated
13+
This rule has been deprecated in favor of the [`perfectionist/sort-intersection-types`](https://eslint-plugin-perfectionist.azat.io/rules/sort-intersection-types) and [`perfectionist/sort-union-types`](https://eslint-plugin-perfectionist.azat.io/rules/sort-union-types) rules.
14+
15+
See [Docs: Deprecate sort-type-constituents in favor of eslint-plugin-perfectionist](https://github.com/typescript-eslint/typescript-eslint/issues/8915) and [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information.
16+
:::
17+
1218
Sorting union (`|`) and intersection (`&`) types can help:
1319

1420
- keep your codebase standardized
@@ -19,15 +25,6 @@ This rule reports on any types that aren't sorted alphabetically.
1925

2026
> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties.
2127
22-
:::note
23-
This rule is _feature frozen_: it will no longer receive new features such as new options.
24-
It still will accept bug and documentation fixes for its existing area of features.
25-
26-
Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested.
27-
This rule has reached the limit of what is reasonable for the typescript-eslint project to maintain.
28-
See [eslint-plugin: Feature freeze naming and sorting stylistic rules](https://github.com/typescript-eslint/typescript-eslint/issues/8792) for more information.
29-
:::
30-
3128
## Examples
3229

3330
<Tabs>

packages/eslint-plugin/src/configs/all.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export = {
147147
'@typescript-eslint/restrict-template-expressions': 'error',
148148
'no-return-await': 'off',
149149
'@typescript-eslint/return-await': 'error',
150-
'@typescript-eslint/sort-type-constituents': 'error',
151150
'@typescript-eslint/strict-boolean-expressions': 'error',
152151
'@typescript-eslint/switch-exhaustiveness-check': 'error',
153152
'@typescript-eslint/triple-slash-reference': 'error',

packages/eslint-plugin/src/rules/sort-type-constituents.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export type MessageIds = 'notSorted' | 'notSortedNamed' | 'suggestFix';
117117
export default createRule<Options, MessageIds>({
118118
name: 'sort-type-constituents',
119119
meta: {
120+
deprecated: true,
121+
replacedBy: [
122+
'perfectionist/sort-intersection-types',
123+
'perfectionist/sort-union-types',
124+
],
120125
type: 'suggestion',
121126
docs: {
122127
description:

packages/typescript-eslint/src/configs/all.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export default (
156156
'@typescript-eslint/restrict-template-expressions': 'error',
157157
'no-return-await': 'off',
158158
'@typescript-eslint/return-await': 'error',
159-
'@typescript-eslint/sort-type-constituents': 'error',
160159
'@typescript-eslint/strict-boolean-expressions': 'error',
161160
'@typescript-eslint/switch-exhaustiveness-check': 'error',
162161
'@typescript-eslint/triple-slash-reference': 'error',

0 commit comments

Comments
 (0)
0