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 +54
-0
lines changed
src/rules/typescript-eslint Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * Array Option.
5
+ */
6
+ export type ArrayOption = 'array' | 'generic' | 'array-simple' ;
7
+
8
+ /**
9
+ * Option.
10
+ */
11
+ export type ArrayTypeOption = {
12
+ /**
13
+ * Sets the array type expected for mutable cases.
14
+ *
15
+ * @default 'array'
16
+ *
17
+ * @see [default](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md#options)
18
+ */
19
+ default : ArrayOption ;
20
+ /**
21
+ * Sets the array type expected for readonly arrays. If this is omitted, then the value for default will be used.
22
+ *
23
+ * @see [readonly](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md#options)
24
+ */
25
+ readonly ?: ArrayOption ;
26
+ } ;
27
+
28
+ /**
29
+ * Options.
30
+ */
31
+ export type ArrayTypeOptions = [ ArrayTypeOption ?] ;
32
+
33
+ /**
34
+ * Requires using either `T[]` or `Array<T>` for arrays.
35
+ *
36
+ * @see [array-type](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md)
37
+ */
38
+ export type ArrayTypeRuleConfig = RuleConfig < ArrayTypeOptions > ;
39
+
40
+ /**
41
+ * Requires using either `T[]` or `Array<T>` for arrays.
42
+ *
43
+ * @see [array-type](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md)
44
+ */
45
+ export interface ArrayTypeRule {
46
+ /**
47
+ * Requires using either `T[]` or `Array<T>` for arrays.
48
+ *
49
+ * @see [array-type](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md)
50
+ */
51
+ '@typescript-eslint/array-type' : ArrayTypeRuleConfig ;
52
+ }
Original file line number Diff line number Diff line change 1
1
import type { AdjacentOverloadSignaturesRule } from './adjacent-overload-signatures' ;
2
+ import type { ArrayTypeRule } from './array-type' ;
2
3
import type { BanTsCommentRule } from './ban-ts-comment' ;
3
4
import type { ExplicitFunctionReturnTypeRule } from './explicit-function-return-type' ;
4
5
import type { InterfaceNamePrefixRule } from './interface-name-prefix' ;
@@ -18,6 +19,7 @@ import type { TypedefRule } from './typedef';
18
19
* All @typescript-eslint rules.
19
20
*/
20
21
export type TypeScriptEslintRules = AdjacentOverloadSignaturesRule &
22
+ ArrayTypeRule &
21
23
BanTsCommentRule &
22
24
ExplicitFunctionReturnTypeRule &
23
25
InterfaceNamePrefixRule &
You can’t perform that action at this time.
0 commit comments