This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
src/rules/typescript-eslint Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * Option.
5
+ */
6
+ export type ConsistentTypeDefinitionsOption = 'type' | 'interface' ;
7
+
8
+ /**
9
+ * Options.
10
+ */
11
+ export type ConsistentTypeDefinitionsOptions = [ ConsistentTypeDefinitionsOption ?] ;
12
+
13
+ /**
14
+ * Consistent with type definition either `interface` or `type`.
15
+ *
16
+ * @default 'interface'
17
+ *
18
+ * @see [consistent-type-definitions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md)
19
+ */
20
+ export type ConsistentTypeDefinitionsRuleConfig = RuleConfig < ConsistentTypeDefinitionsOptions > ;
21
+
22
+ /**
23
+ * Consistent with type definition either `interface` or `type`.
24
+ *
25
+ * @default 'interface'
26
+ *
27
+ * @see [consistent-type-definitions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md)
28
+ */
29
+ export interface ConsistentTypeDefinitionsRule {
30
+ /**
31
+ * Consistent with type definition either `interface` or `type`.
32
+ *
33
+ * @default 'interface'
34
+ *
35
+ * @see [consistent-type-definitions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md)
36
+ */
37
+ '@typescript-eslint/consistent-type-definitions' : ConsistentTypeDefinitionsRuleConfig ;
38
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type { AwaitThenableRule } from './await-thenable';
4
4
import type { BanTsCommentRule } from './ban-ts-comment' ;
5
5
import type { BanTypesRule } from './ban-types' ;
6
6
import type { ConsistentTypeAssertionsRule } from './consistent-type-assertions' ;
7
+ import type { ConsistentTypeDefinitionsRule } from './consistent-type-definitions' ;
7
8
import type { ExplicitFunctionReturnTypeRule } from './explicit-function-return-type' ;
8
9
import type { IndentRule } from './indent' ;
9
10
import type { InterfaceNamePrefixRule } from './interface-name-prefix' ;
@@ -31,6 +32,7 @@ export type TypeScriptEslintRules = AdjacentOverloadSignaturesRule &
31
32
ConsistentTypeAssertionsRule &
32
33
ExplicitFunctionReturnTypeRule &
33
34
IndentRule &
35
+ ConsistentTypeDefinitionsRule &
34
36
InterfaceNamePrefixRule &
35
37
MemberOrderingRule &
36
38
NoExplicitAnyRule &
You can’t perform that action at this time.
0 commit comments