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

Commit 90acd74

Browse files
authored
Patch rule files automatically (#180)
1 parent c61ccd8 commit 90acd74

12 files changed

+385
-6
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git b/src/rules/eslint/no-constructor-return.d.ts a/src/rules/eslint/no-constructor-return.d.ts
2+
index fedeca4..3e1fd03 100644
3+
--- b/src/rules/eslint/no-constructor-return.d.ts
4+
+++ a/src/rules/eslint/no-constructor-return.d.ts
5+
@@ -1,16 +1,9 @@
6+
import type { RuleConfig } from '../rule-config';
7+
8+
-/**
9+
- * Option.
10+
- */
11+
-export interface NoConstructorReturnOption {
12+
- [k: string]: any;
13+
-}
14+
-
15+
/**
16+
* Options.
17+
*/
18+
-export type NoConstructorReturnOptions = NoConstructorReturnOption;
19+
+export type NoConstructorReturnOptions = [];
20+
21+
/**
22+
* Disallow returning value from constructor.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git b/src/rules/graphql-eslint/naming-convention.d.ts a/src/rules/graphql-eslint/naming-convention.d.ts
2+
index 60b228b..5e01373 100644
3+
--- b/src/rules/graphql-eslint/naming-convention.d.ts
4+
+++ a/src/rules/graphql-eslint/naming-convention.d.ts
5+
@@ -78,8 +78,7 @@ export type NamingConventionOption =
6+
VariableDefinition?: AsString | AsObject;
7+
allowLeadingUnderscore?: boolean;
8+
allowTrailingUnderscore?: boolean;
9+
- /**
10+
- */
11+
+ } & {
12+
[k: string]: AsString | AsObject;
13+
},
14+
];
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git b/src/rules/node/file-extension-in-import.d.ts a/src/rules/node/file-extension-in-import.d.ts
2+
index 652b18d..7261252 100644
3+
--- b/src/rules/node/file-extension-in-import.d.ts
4+
+++ a/src/rules/node/file-extension-in-import.d.ts
5+
@@ -5,7 +5,7 @@ import type { RuleConfig } from '../rule-config';
6+
*/
7+
export interface FileExtensionInImportConfig {
8+
tryExtensions?: string[];
9+
- [k: string]: 'always' | 'never';
10+
+ [ext: `.${string}`]: 'always' | 'never';
11+
}
12+
13+
/**
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git b/src/rules/typescript-eslint/array-type.d.ts a/src/rules/typescript-eslint/array-type.d.ts
2+
index 98cd312..fe661fc 100644
3+
--- b/src/rules/typescript-eslint/array-type.d.ts
4+
+++ a/src/rules/typescript-eslint/array-type.d.ts
5+
@@ -3,12 +3,16 @@ import type { RuleConfig } from '../rule-config';
6+
/**
7+
* Option.
8+
*/
9+
-export type ArrayTypeOption = any[];
10+
+export interface ArrayTypeOption {
11+
+ default?: 'array' | 'generic' | 'array-simple';
12+
+ readonly?: 'array' | 'generic' | 'array-simple';
13+
+ [k: string]: any;
14+
+}
15+
16+
/**
17+
* Options.
18+
*/
19+
-export type ArrayTypeOptions = ArrayTypeOption;
20+
+export type ArrayTypeOptions = [ArrayTypeOption?];
21+
22+
/**
23+
* Require consistently using either `T[]` or `Array<T>` for arrays.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff --git b/src/rules/typescript-eslint/ban-ts-comment.d.ts a/src/rules/typescript-eslint/ban-ts-comment.d.ts
2+
index 111f9c9..5d489f8 100644
3+
--- b/src/rules/typescript-eslint/ban-ts-comment.d.ts
4+
+++ a/src/rules/typescript-eslint/ban-ts-comment.d.ts
5+
@@ -3,12 +3,42 @@ import type { RuleConfig } from '../rule-config';
6+
/**
7+
* Option.
8+
*/
9+
-export type BanTsCommentOption = any[];
10+
+export interface BanTsCommentOption {
11+
+ 'ts-expect-error'?:
12+
+ | boolean
13+
+ | 'allow-with-description'
14+
+ | {
15+
+ descriptionFormat?: string;
16+
+ [k: string]: any;
17+
+ };
18+
+ 'ts-ignore'?:
19+
+ | boolean
20+
+ | 'allow-with-description'
21+
+ | {
22+
+ descriptionFormat?: string;
23+
+ [k: string]: any;
24+
+ };
25+
+ 'ts-nocheck'?:
26+
+ | boolean
27+
+ | 'allow-with-description'
28+
+ | {
29+
+ descriptionFormat?: string;
30+
+ [k: string]: any;
31+
+ };
32+
+ 'ts-check'?:
33+
+ | boolean
34+
+ | 'allow-with-description'
35+
+ | {
36+
+ descriptionFormat?: string;
37+
+ [k: string]: any;
38+
+ };
39+
+ minimumDescriptionLength?: number;
40+
+}
41+
42+
/**
43+
* Options.
44+
*/
45+
-export type BanTsCommentOptions = BanTsCommentOption;
46+
+export type BanTsCommentOptions = [BanTsCommentOption?];
47+
48+
/**
49+
* Disallow `@ts-<directive>` comments or require descriptions after directives.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
2+
index b585e26..1711d51 100644
3+
--- b/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
4+
+++ a/src/rules/typescript-eslint/explicit-member-accessibility.d.ts
5+
@@ -3,13 +3,24 @@ import type { RuleConfig } from '../rule-config';
6+
/**
7+
* Option.
8+
*/
9+
-export type ExplicitMemberAccessibilityOption = any[];
10+
+export interface ExplicitMemberAccessibilityOption {
11+
+ accessibility?: 'explicit' | 'no-public' | 'off';
12+
+ overrides?: {
13+
+ accessors?: 'explicit' | 'no-public' | 'off';
14+
+ constructors?: 'explicit' | 'no-public' | 'off';
15+
+ methods?: 'explicit' | 'no-public' | 'off';
16+
+ properties?: 'explicit' | 'no-public' | 'off';
17+
+ parameterProperties?: 'explicit' | 'no-public' | 'off';
18+
+ };
19+
+ ignoredMethodNames?: string[];
20+
+}
21+
22+
/**
23+
* Options.
24+
*/
25+
-export type ExplicitMemberAccessibilityOptions =
26+
- ExplicitMemberAccessibilityOption;
27+
+export type ExplicitMemberAccessibilityOptions = [
28+
+ ExplicitMemberAccessibilityOption?,
29+
+];
30+
31+
/**
32+
* Require explicit accessibility modifiers on class properties and methods.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git b/src/rules/typescript-eslint/lines-between-class-members.d.ts a/src/rules/typescript-eslint/lines-between-class-members.d.ts
2+
index 46caad7..afdd87e 100644
3+
--- b/src/rules/typescript-eslint/lines-between-class-members.d.ts
4+
+++ a/src/rules/typescript-eslint/lines-between-class-members.d.ts
5+
@@ -1,16 +1,23 @@
6+
+import type {
7+
+ LinesBetweenClassMembersConfig as BaseConfig,
8+
+ LinesBetweenClassMembersOption,
9+
+} from '../eslint/lines-between-class-members';
10+
import type { RuleConfig } from '../rule-config';
11+
12+
/**
13+
- * Option.
14+
+ * Config.
15+
*/
16+
-export interface LinesBetweenClassMembersOption {
17+
- [k: string]: any;
18+
+export interface LinesBetweenClassMembersConfig extends BaseConfig {
19+
+ exceptAfterOverload?: boolean;
20+
}
21+
22+
/**
23+
* Options.
24+
*/
25+
-export type LinesBetweenClassMembersOptions = LinesBetweenClassMembersOption;
26+
+export type LinesBetweenClassMembersOptions = [
27+
+ LinesBetweenClassMembersOption?,
28+
+ LinesBetweenClassMembersConfig?,
29+
+];
30+
31+
/**
32+
* Require or disallow an empty line between class members.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
diff --git b/src/rules/typescript-eslint/parameter-properties.d.ts a/src/rules/typescript-eslint/parameter-properties.d.ts
2+
index 6b0f176..591a9a4 100644
3+
--- b/src/rules/typescript-eslint/parameter-properties.d.ts
4+
+++ a/src/rules/typescript-eslint/parameter-properties.d.ts
5+
@@ -3,12 +3,37 @@ import type { RuleConfig } from '../rule-config';
6+
/**
7+
* Option.
8+
*/
9+
-export type ParameterPropertiesOption = any[];
10+
+export interface ParameterPropertiesOption {
11+
+ /**
12+
+ * @minItems 1
13+
+ */
14+
+ allow?: [
15+
+ (
16+
+ | 'readonly'
17+
+ | 'private'
18+
+ | 'protected'
19+
+ | 'public'
20+
+ | 'private readonly'
21+
+ | 'protected readonly'
22+
+ | 'public readonly'
23+
+ ),
24+
+ ...(
25+
+ | 'readonly'
26+
+ | 'private'
27+
+ | 'protected'
28+
+ | 'public'
29+
+ | 'private readonly'
30+
+ | 'protected readonly'
31+
+ | 'public readonly'
32+
+ )[],
33+
+ ];
34+
+ prefer?: 'class-property' | 'parameter-property';
35+
+}
36+
37+
/**
38+
* Options.
39+
*/
40+
-export type ParameterPropertiesOptions = ParameterPropertiesOption;
41+
+export type ParameterPropertiesOptions = [ParameterPropertiesOption?];
42+
43+
/**
44+
* Require or disallow parameter properties in class constructors.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
diff --git b/src/rules/unicorn/import-index.d.ts a/src/rules/unicorn/import-index.d.ts
2+
index a1ce37b..41805a7 100644
3+
--- b/src/rules/unicorn/import-index.d.ts
4+
+++ a/src/rules/unicorn/import-index.d.ts
5+
@@ -1,25 +1,49 @@
6+
import type { RuleConfig } from '../rule-config';
7+
8+
/**
9+
+ * Option.
10+
+ *
11+
+ * @deprecated
12+
+ */
13+
+export interface ImportIndexOption {
14+
+ /**
15+
+ * @deprecated
16+
+ */
17+
+ ignoreImports?: boolean;
18+
+}
19+
+
20+
+/**
21+
+ * Options.
22+
+ *
23+
+ * @deprecated
24+
+ *
25+
+ * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v43.0.2/docs/deprecated-rules.md#import-index)
26+
+ */
27+
+export type ImportIndexOptions = [ImportIndexOption?];
28+
+
29+
+/**
30+
+ * Enforce importing index files with `.`.
31+
*
32+
* @deprecated
33+
*
34+
- * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/deprecated-rules.md#import-index)
35+
+ * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v42.0.0/docs/rules/import-index.md)
36+
*/
37+
-export type ImportIndexRuleConfig = RuleConfig<[]>;
38+
+export type ImportIndexRuleConfig = RuleConfig<ImportIndexOptions>;
39+
40+
/**
41+
+ * Enforce importing index files with `.`.
42+
*
43+
* @deprecated
44+
*
45+
- * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/deprecated-rules.md#import-index)
46+
+ * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v43.0.2/docs/deprecated-rules.md#import-index)
47+
*/
48+
export interface ImportIndexRule {
49+
/**
50+
+ * Enforce importing index files with `.`.
51+
*
52+
* @deprecated
53+
*
54+
- * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/deprecated-rules.md#import-index)
55+
+ * @see [import-index](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v43.0.2/docs/deprecated-rules.md#import-index)
56+
*/
57+
'unicorn/import-index': ImportIndexRuleConfig;
58+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
diff --git b/src/rules/unicorn/prefer-node-protocol.d.ts a/src/rules/unicorn/prefer-node-protocol.d.ts
2+
index 74279c2..a7e17b8 100644
3+
--- b/src/rules/unicorn/prefer-node-protocol.d.ts
4+
+++ a/src/rules/unicorn/prefer-node-protocol.d.ts
5+
@@ -1,22 +1,42 @@
6+
import type { RuleConfig } from '../rule-config';
7+
8+
+/**
9+
+ * Option.
10+
+ *
11+
+ * @deprecated
12+
+ */
13+
+export interface PreferNodeProtocolOption {
14+
+ /**
15+
+ * @deprecated
16+
+ */
17+
+ checkRequire?: boolean;
18+
+}
19+
+
20+
+/**
21+
+ * Options.
22+
+ *
23+
+ * @deprecated
24+
+ */
25+
+export type PreferNodeProtocolOptions = [PreferNodeProtocolOption?];
26+
+
27+
/**
28+
* Prefer using the `node:` protocol when importing Node.js builtin modules.
29+
*
30+
- * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/rules/prefer-node-protocol.md)
31+
+ * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v44.0.2/docs/rules/prefer-node-protocol.md)
32+
*/
33+
-export type PreferNodeProtocolRuleConfig = RuleConfig<[]>;
34+
+export type PreferNodeProtocolRuleConfig =
35+
+ RuleConfig<PreferNodeProtocolOptions>;
36+
37+
/**
38+
* Prefer using the `node:` protocol when importing Node.js builtin modules.
39+
*
40+
- * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/rules/prefer-node-protocol.md)
41+
+ * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v44.0.2/docs/rules/prefer-node-protocol.md)
42+
*/
43+
export interface PreferNodeProtocolRule {
44+
/**
45+
* Prefer using the `node:` protocol when importing Node.js builtin modules.
46+
*
47+
- * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v46.0.0/docs/rules/prefer-node-protocol.md)
48+
+ * @see [prefer-node-protocol](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v44.0.2/docs/rules/prefer-node-protocol.md)
49+
*/
50+
'unicorn/prefer-node-protocol': PreferNodeProtocolRuleConfig;
51+
}

0 commit comments

Comments
 (0)