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

Commit 852375d

Browse files
committed
Update typescript-eslint rules
1 parent b8bbe2c commit 852375d

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import type { NoBaseToStringRule } from './no-base-to-string';
3232
import type { NoConfusingNonNullAssertionRule } from './no-confusing-non-null-assertion';
3333
import type { NoConfusingVoidExpressionRule } from './no-confusing-void-expression';
3434
import type { NoDupeClassMembersRule } from './no-dupe-class-members';
35+
import type { NoDuplicateEnumValuesRule } from './no-duplicate-enum-values';
3536
import type { NoDuplicateImportsRule } from './no-duplicate-imports';
3637
import type { NoDynamicDeleteRule } from './no-dynamic-delete';
3738
import type { NoEmptyFunctionRule } from './no-empty-function';
@@ -87,6 +88,7 @@ import type { NoVarRequiresRule } from './no-var-requires';
8788
import type { NonNullableTypeAssertionStyleRule } from './non-nullable-type-assertion-style';
8889
import type { ObjectCurlySpacingRule } from './object-curly-spacing';
8990
import type { PaddingLineBetweenStatementsRule } from './padding-line-between-statements';
91+
import type { ParameterPropertiesRule } from './parameter-properties';
9092
import type { PreferAsConstRule } from './prefer-as-const';
9193
import type { PreferEnumInitializersRule } from './prefer-enum-initializers';
9294
import type { PreferForOfRule } from './prefer-for-of';
@@ -160,6 +162,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
160162
NoConfusingNonNullAssertionRule &
161163
NoConfusingVoidExpressionRule &
162164
NoDupeClassMembersRule &
165+
NoDuplicateEnumValuesRule &
163166
NoDuplicateImportsRule &
164167
NoDynamicDeleteRule &
165168
NoEmptyFunctionRule &
@@ -215,6 +218,7 @@ export type TypeScriptRules = AdjacentOverloadSignaturesRule &
215218
NonNullableTypeAssertionStyleRule &
216219
ObjectCurlySpacingRule &
217220
PaddingLineBetweenStatementsRule &
221+
ParameterPropertiesRule &
218222
PreferAsConstRule &
219223
PreferEnumInitializersRule &
220224
PreferForOfRule &
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 duplicate enum member values.
5+
*
6+
* @see [no-duplicate-enum-values](https://typescript-eslint.io/rules/no-duplicate-enum-values)
7+
*/
8+
export type NoDuplicateEnumValuesRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow duplicate enum member values.
12+
*
13+
* @see [no-duplicate-enum-values](https://typescript-eslint.io/rules/no-duplicate-enum-values)
14+
*/
15+
export interface NoDuplicateEnumValuesRule {
16+
/**
17+
* Disallow duplicate enum member values.
18+
*
19+
* @see [no-duplicate-enum-values](https://typescript-eslint.io/rules/no-duplicate-enum-values)
20+
*/
21+
'@typescript-eslint/no-duplicate-enum-values': NoDuplicateEnumValuesRuleConfig;
22+
}

src/rules/typescript-eslint/no-parameter-properties.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export type NoParameterPropertiesOptions = [NoParameterPropertiesOption?];
3434
/**
3535
* Disallow the use of parameter properties in class constructors.
3636
*
37+
* @deprecated
38+
*
3739
* @see [no-parameter-properties](https://typescript-eslint.io/rules/no-parameter-properties)
3840
*/
3941
export type NoParameterPropertiesRuleConfig =
@@ -42,12 +44,16 @@ export type NoParameterPropertiesRuleConfig =
4244
/**
4345
* Disallow the use of parameter properties in class constructors.
4446
*
47+
* @deprecated
48+
*
4549
* @see [no-parameter-properties](https://typescript-eslint.io/rules/no-parameter-properties)
4650
*/
4751
export interface NoParameterPropertiesRule {
4852
/**
4953
* Disallow the use of parameter properties in class constructors.
5054
*
55+
* @deprecated
56+
*
5157
* @see [no-parameter-properties](https://typescript-eslint.io/rules/no-parameter-properties)
5258
*/
5359
'@typescript-eslint/no-parameter-properties': NoParameterPropertiesRuleConfig;
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface ParameterPropertiesOption {
7+
allow?: [
8+
(
9+
| 'readonly'
10+
| 'private'
11+
| 'protected'
12+
| 'public'
13+
| 'private readonly'
14+
| 'protected readonly'
15+
| 'public readonly'
16+
),
17+
...(
18+
| 'readonly'
19+
| 'private'
20+
| 'protected'
21+
| 'public'
22+
| 'private readonly'
23+
| 'protected readonly'
24+
| 'public readonly'
25+
)[],
26+
];
27+
prefer?: 'class-property' | 'parameter-property';
28+
}
29+
30+
/**
31+
* Options.
32+
*/
33+
export type ParameterPropertiesOptions = [ParameterPropertiesOption?];
34+
35+
/**
36+
* Require or disallow the use of parameter properties in class constructors.
37+
*
38+
* @see [parameter-properties](https://typescript-eslint.io/rules/parameter-properties)
39+
*/
40+
export type ParameterPropertiesRuleConfig =
41+
RuleConfig<ParameterPropertiesOptions>;
42+
43+
/**
44+
* Require or disallow the use of parameter properties in class constructors.
45+
*
46+
* @see [parameter-properties](https://typescript-eslint.io/rules/parameter-properties)
47+
*/
48+
export interface ParameterPropertiesRule {
49+
/**
50+
* Require or disallow the use of parameter properties in class constructors.
51+
*
52+
* @see [parameter-properties](https://typescript-eslint.io/rules/parameter-properties)
53+
*/
54+
'@typescript-eslint/parameter-properties': ParameterPropertiesRuleConfig;
55+
}

0 commit comments

Comments
 (0)