Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit a81b23b

Browse files
committed
Update typescript-eslint rules
1 parent 5320483 commit a81b23b

File tree

5 files changed

+107
-5
lines changed

5 files changed

+107
-5
lines changed

src/rules/typescript-eslint/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import type { NoUnnecessaryTypeConstraintRule } from './no-unnecessary-type-cons
7878
import type { NoUnsafeArgumentRule } from './no-unsafe-argument';
7979
import type { NoUnsafeAssignmentRule } from './no-unsafe-assignment';
8080
import type { NoUnsafeCallRule } from './no-unsafe-call';
81+
import type { NoUnsafeDeclarationMergingRule } from './no-unsafe-declaration-merging';
8182
import type { NoUnsafeMemberAccessRule } from './no-unsafe-member-access';
8283
import type { NoUnsafeReturnRule } from './no-unsafe-return';
8384
import type { NoUnusedExpressionsRule } from './no-unused-expressions';
@@ -114,6 +115,7 @@ import type { RestrictPlusOperandsRule } from './restrict-plus-operands';
114115
import type { RestrictTemplateExpressionsRule } from './restrict-template-expressions';
115116
import type { ReturnAwaitRule } from './return-await';
116117
import type { SemiRule } from './semi';
118+
import type { SortTypeConstituentsRule } from './sort-type-constituents';
117119
import type { SortTypeUnionIntersectionMembersRule } from './sort-type-union-intersection-members';
118120
import type { SpaceBeforeBlocksRule } from './space-before-blocks';
119121
import type { SpaceBeforeFunctionParenRule } from './space-before-function-paren';
@@ -209,6 +211,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
209211
NoUnsafeArgumentRule &
210212
NoUnsafeAssignmentRule &
211213
NoUnsafeCallRule &
214+
NoUnsafeDeclarationMergingRule &
212215
NoUnsafeMemberAccessRule &
213216
NoUnsafeReturnRule &
214217
NoUnusedExpressionsRule &
@@ -245,6 +248,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
245248
RestrictTemplateExpressionsRule &
246249
ReturnAwaitRule &
247250
SemiRule &
251+
SortTypeConstituentsRule &
248252
SortTypeUnionIntersectionMembersRule &
249253
SpaceBeforeBlocksRule &
250254
SpaceBeforeFunctionParenRule &

src/rules/typescript-eslint/member-ordering.d.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,9 @@ export interface MemberOrderingOption {
480480
order?:
481481
| 'alphabetically'
482482
| 'alphabetically-case-insensitive'
483-
| 'as-written';
483+
| 'as-written'
484+
| 'natural'
485+
| 'natural-case-insensitive';
484486
};
485487
classes?:
486488
| 'never'
@@ -958,7 +960,9 @@ export interface MemberOrderingOption {
958960
order?:
959961
| 'alphabetically'
960962
| 'alphabetically-case-insensitive'
961-
| 'as-written';
963+
| 'as-written'
964+
| 'natural'
965+
| 'natural-case-insensitive';
962966
};
963967
classExpressions?:
964968
| 'never'
@@ -1436,7 +1440,9 @@ export interface MemberOrderingOption {
14361440
order?:
14371441
| 'alphabetically'
14381442
| 'alphabetically-case-insensitive'
1439-
| 'as-written';
1443+
| 'as-written'
1444+
| 'natural'
1445+
| 'natural-case-insensitive';
14401446
};
14411447
interfaces?:
14421448
| 'never'
@@ -1454,7 +1460,9 @@ export interface MemberOrderingOption {
14541460
order?:
14551461
| 'alphabetically'
14561462
| 'alphabetically-case-insensitive'
1457-
| 'as-written';
1463+
| 'as-written'
1464+
| 'natural'
1465+
| 'natural-case-insensitive';
14581466
};
14591467
typeLiterals?:
14601468
| 'never'
@@ -1472,7 +1480,9 @@ export interface MemberOrderingOption {
14721480
order?:
14731481
| 'alphabetically'
14741482
| 'alphabetically-case-insensitive'
1475-
| 'as-written';
1483+
| 'as-written'
1484+
| 'natural'
1485+
| 'natural-case-insensitive';
14761486
};
14771487
}
14781488

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Disallow unsafe declaration merging.
5+
*
6+
* @see [no-unsafe-declaration-merging](https://typescript-eslint.io/rules/no-unsafe-declaration-merging)
7+
*/
8+
export type NoUnsafeDeclarationMergingRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow unsafe declaration merging.
12+
*
13+
* @see [no-unsafe-declaration-merging](https://typescript-eslint.io/rules/no-unsafe-declaration-merging)
14+
*/
15+
export interface NoUnsafeDeclarationMergingRule {
16+
/**
17+
* Disallow unsafe declaration merging.
18+
*
19+
* @see [no-unsafe-declaration-merging](https://typescript-eslint.io/rules/no-unsafe-declaration-merging)
20+
*/
21+
'@typescript-eslint/no-unsafe-declaration-merging': NoUnsafeDeclarationMergingRuleConfig;
22+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface SortTypeConstituentsOption {
7+
/**
8+
* Whether to check intersection types.
9+
*/
10+
checkIntersections?: boolean;
11+
/**
12+
* Whether to check union types.
13+
*/
14+
checkUnions?: boolean;
15+
/**
16+
* Ordering of the groups.
17+
*/
18+
groupOrder?: (
19+
| 'conditional'
20+
| 'function'
21+
| 'import'
22+
| 'intersection'
23+
| 'keyword'
24+
| 'nullish'
25+
| 'literal'
26+
| 'named'
27+
| 'object'
28+
| 'operator'
29+
| 'tuple'
30+
| 'union'
31+
)[];
32+
[k: string]: any;
33+
}
34+
35+
/**
36+
* Options.
37+
*/
38+
export type SortTypeConstituentsOptions = [SortTypeConstituentsOption?];
39+
40+
/**
41+
* Enforce constituents of a type union/intersection to be sorted alphabetically.
42+
*
43+
* @see [sort-type-constituents](https://typescript-eslint.io/rules/sort-type-constituents)
44+
*/
45+
export type SortTypeConstituentsRuleConfig =
46+
RuleConfig<SortTypeConstituentsOptions>;
47+
48+
/**
49+
* Enforce constituents of a type union/intersection to be sorted alphabetically.
50+
*
51+
* @see [sort-type-constituents](https://typescript-eslint.io/rules/sort-type-constituents)
52+
*/
53+
export interface SortTypeConstituentsRule {
54+
/**
55+
* Enforce constituents of a type union/intersection to be sorted alphabetically.
56+
*
57+
* @see [sort-type-constituents](https://typescript-eslint.io/rules/sort-type-constituents)
58+
*/
59+
'@typescript-eslint/sort-type-constituents': SortTypeConstituentsRuleConfig;
60+
}

src/rules/typescript-eslint/sort-type-union-intersection-members.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export type SortTypeUnionIntersectionMembersOptions = [
4242
/**
4343
* Enforce members of a type union/intersection to be sorted alphabetically.
4444
*
45+
* @deprecated
46+
*
4547
* @see [sort-type-union-intersection-members](https://typescript-eslint.io/rules/sort-type-union-intersection-members)
4648
*/
4749
export type SortTypeUnionIntersectionMembersRuleConfig =
@@ -50,12 +52,16 @@ export type SortTypeUnionIntersectionMembersRuleConfig =
5052
/**
5153
* Enforce members of a type union/intersection to be sorted alphabetically.
5254
*
55+
* @deprecated
56+
*
5357
* @see [sort-type-union-intersection-members](https://typescript-eslint.io/rules/sort-type-union-intersection-members)
5458
*/
5559
export interface SortTypeUnionIntersectionMembersRule {
5660
/**
5761
* Enforce members of a type union/intersection to be sorted alphabetically.
5862
*
63+
* @deprecated
64+
*
5965
* @see [sort-type-union-intersection-members](https://typescript-eslint.io/rules/sort-type-union-intersection-members)
6066
*/
6167
'@typescript-eslint/sort-type-union-intersection-members': SortTypeUnionIntersectionMembersRuleConfig;

0 commit comments

Comments
 (0)