Skip to content

Commit 0fbfdbc

Browse files
Change style of TS Array types (#267)
1 parent d7ad02d commit 0fbfdbc

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

.eslintrc.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ overrides:
3232
- 'plugin:@typescript-eslint/recommended'
3333
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
3434
rules:
35+
'@typescript-eslint/array-type': [error, { default: generic }]
3536
'@typescript-eslint/consistent-indexed-object-style':
3637
[error, index-signature]
3738

@@ -54,7 +55,3 @@ overrides:
5455
'@typescript-eslint/no-unsafe-member-access': off
5556
'@typescript-eslint/no-unnecessary-condition': off
5657
'@typescript-eslint/restrict-template-expressions': off
57-
58-
- files: ['scripts/**/*.ts']
59-
rules:
60-
'@typescript-eslint/array-type': [error, { default: generic }]

src/components/doc-explorer/TypeDoc.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export default class TypeDoc extends Component<TypeDocProps> {
5959

6060
function renderTypesDef(type: SimplifiedTypeWithIDs, selectedId) {
6161
let typesTitle;
62-
let types: {
62+
let types: Array<{
6363
id: string;
6464
type: SimplifiedTypeWithIDs;
65-
}[];
65+
}>;
6666

6767
switch (type.kind) {
6868
case 'UNION':

src/graph/svg-renderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface RenderResponse {
3232
export class SVGRender {
3333
private _worker: Worker;
3434

35-
private _listeners: RenderRequestListener[] = [];
35+
private _listeners: Array<RenderRequestListener> = [];
3636
private _nextId = 0;
3737

3838
constructor() {

src/introspection/types.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface SimplifiedArg {
44
name: string;
55
description: string;
66
defaultValue: any;
7-
typeWrappers: ('NON_NULL' | 'LIST')[];
7+
typeWrappers: Array<'NON_NULL' | 'LIST'>;
88
id?: string;
99
}
1010

@@ -14,7 +14,7 @@ export interface SimplifiedField<T> {
1414
id?: string;
1515
relayType?: T;
1616
description: string;
17-
typeWrappers: ('NON_NULL' | 'LIST')[];
17+
typeWrappers: Array<'NON_NULL' | 'LIST'>;
1818
isDeprecated: boolean;
1919
deprecationReason?: string;
2020
args: {
@@ -31,7 +31,7 @@ export interface SimplifiedTypeBase {
3131
kind: 'OBJECT' | 'INTERFACE' | 'UNION' | 'ENUM' | 'INPUT_OBJECT' | 'SCALAR';
3232
name: string;
3333
description: string;
34-
enumValues?: IntrospectionEnumValue[];
34+
enumValues?: Array<IntrospectionEnumValue>;
3535
inputFields?: {
3636
[name: string]: SimplifiedInputField;
3737
};
@@ -43,28 +43,28 @@ export type SimplifiedType = SimplifiedTypeBase & {
4343
fields?: {
4444
[name: string]: SimplifiedField<string>;
4545
};
46-
interfaces?: string[];
47-
derivedTypes?: string[];
48-
possibleTypes?: string[];
46+
interfaces?: Array<string>;
47+
derivedTypes?: Array<string>;
48+
possibleTypes?: Array<string>;
4949
};
5050

5151
export type SimplifiedTypeWithIDs = SimplifiedTypeBase & {
5252
id: string;
5353
fields?: {
5454
[name: string]: SimplifiedField<SimplifiedTypeWithIDs>;
5555
};
56-
interfaces?: {
56+
interfaces?: Array<{
5757
id: string;
5858
type: SimplifiedTypeWithIDs;
59-
}[];
60-
derivedTypes?: {
59+
}>;
60+
derivedTypes?: Array<{
6161
id: string;
6262
type: SimplifiedTypeWithIDs;
63-
}[];
64-
possibleTypes?: {
63+
}>;
64+
possibleTypes?: Array<{
6565
id: string;
6666
type: SimplifiedTypeWithIDs;
67-
}[];
67+
}>;
6868
};
6969

7070
export interface SimplifiedIntrospection {

0 commit comments

Comments
 (0)