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

Commit a63ad7c

Browse files
danielreardenIvanGoncharov
authored andcommitted
Switch to alternative format for type imports
1 parent 975ba2c commit a63ad7c

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

.eslintrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ rules:
5252
flowtype/sort-keys: off
5353
flowtype/spread-exact-type: off
5454
flowtype/type-id-match: [error, '^[A-Z]|^\$']
55-
flowtype/type-import-style: [error, identifier, { ignoreTypeDefault: true }]
55+
flowtype/type-import-style: [error, declaration]
5656
flowtype/use-flow-type: error
5757

5858
# Bellow rules are disabled because coflicts with Prettier, see:
@@ -391,7 +391,7 @@ rules:
391391
no-class-assign: error
392392
no-const-assign: error
393393
no-dupe-class-members: error
394-
no-duplicate-imports: error
394+
no-duplicate-imports: off # Superseded by `import/no-duplicates`
395395
no-new-symbol: error
396396
no-restricted-exports: off
397397
no-restricted-imports: off

src/__tests__/http-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import restify from 'restify';
88
import supertest from 'supertest';
99
import bodyParser from 'body-parser';
1010

11+
import type { ASTVisitor, ValidationContext } from 'graphql';
1112
import sinon from 'sinon';
1213
import multer from 'multer';
1314
import { expect } from 'chai';
1415
import { describe, it } from 'mocha';
1516
import {
16-
type ASTVisitor,
17-
type ValidationContext,
1817
Source,
1918
GraphQLError,
2019
GraphQLString,

src/index.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
// @flow strict
22

3-
import { type IncomingMessage, type ServerResponse } from 'http';
4-
3+
import type { IncomingMessage, ServerResponse } from 'http';
4+
5+
import type {
6+
ASTVisitor,
7+
DocumentNode,
8+
ValidationRule,
9+
ValidationContext,
10+
ExecutionArgs,
11+
ExecutionResult,
12+
GraphQLError,
13+
GraphQLSchema,
14+
GraphQLFieldResolver,
15+
GraphQLTypeResolver,
16+
} from 'graphql';
517
import accepts from 'accepts';
618
import httpError from 'http-errors';
719
import {
@@ -13,24 +25,11 @@ import {
1325
validateSchema,
1426
getOperationAST,
1527
specifiedRules,
16-
type ASTVisitor,
17-
type DocumentNode,
18-
type ValidationRule,
19-
type ValidationContext,
20-
type ExecutionArgs,
21-
type ExecutionResult,
22-
type GraphQLError,
23-
type GraphQLSchema,
24-
type GraphQLFieldResolver,
25-
type GraphQLTypeResolver,
2628
} from 'graphql';
2729

30+
import type { GraphiQLOptions, GraphiQLData } from './renderGraphiQL';
2831
import { parseBody } from './parseBody';
29-
import {
30-
renderGraphiQL,
31-
type GraphiQLOptions,
32-
type GraphiQLData,
33-
} from './renderGraphiQL';
32+
import { renderGraphiQL } from './renderGraphiQL';
3433

3534
type $Request = IncomingMessage;
3635
type $Response = ServerResponse & {| json?: (data: mixed) => void |};

src/parseBody.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// @flow strict
22

3-
import { type IncomingMessage } from 'http';
4-
import zlib, { type Inflate, type Gunzip } from 'zlib';
3+
import type { IncomingMessage } from 'http';
4+
import type { Inflate, Gunzip } from 'zlib';
5+
import zlib from 'zlib';
56
import querystring from 'querystring';
67

78
import getBody from 'raw-body';

src/renderGraphiQL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow strict
22

3-
import { type ExecutionResult } from 'graphql';
3+
import type { ExecutionResult } from 'graphql';
44

55
export type GraphiQLData = {|
66
query?: string | null,

0 commit comments

Comments
 (0)