Skip to content

Commit

Permalink
Update tslint, fix new lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
helfer committed Apr 12, 2017
1 parent ab083a8 commit c089cd8
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion benchmark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const createReservations = (count: number) => {

group((end) => {
benchmark('constructing an instance', (done) => {
new ApolloClient({});
const c = new ApolloClient({});
done();
});
end();
Expand Down
4 changes: 2 additions & 2 deletions benchmark/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type DoneFunction = () => void;
export interface DescriptionObject {
name: string;
[other: string]: any;
};
}

export type Nullable<T> = T | undefined;
export type Description = DescriptionObject | string;
Expand Down Expand Up @@ -59,7 +59,7 @@ interface Scope {
benchmark?: BenchmarkFunction;
afterEach?: AfterEachFunction;
afterAll?: AfterAllFunction;
};
}

// Internal function that returns the current exposed functions
// benchmark, setup, etc.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"es6-promise": "^4.0.4",
"fetch-mock": "^5.5.0",
"grunt": "1.0.1",
"grunt-tslint": "4.0.1",
"grunt-tslint": "^5.0.1",
"gzip-size": "^3.0.0",
"isomorphic-fetch": "^2.2.1",
"istanbul": "^0.4.5",
Expand All @@ -90,7 +90,7 @@
"rxjs": "^5.0.0-beta.11",
"sinon": "^2.1.0",
"source-map-support": "^0.4.0",
"tslint": "4.5.1",
"tslint": "^5.1.0",
"typescript": "2.2.2",
"uglify-js": "^2.6.2",
"webpack": "^2.1.0-beta.28",
Expand Down
12 changes: 6 additions & 6 deletions src/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export default class ApolloClient implements DataProxy {
}

return this.queryManager.watchQuery<T>(options);
};
}

/**
* This resolves a single query according to the options specified and returns a
Expand All @@ -323,7 +323,7 @@ export default class ApolloClient implements DataProxy {
}

return this.queryManager.query<T>(options);
};
}

/**
* This resolves a single mutation according to the options specified and returns a
Expand All @@ -336,7 +336,7 @@ export default class ApolloClient implements DataProxy {
this.initStore();

return this.queryManager.mutate<T>(options);
};
}

public subscribe(options: SubscriptionOptions): Observable<any> {
this.initStore();
Expand Down Expand Up @@ -467,7 +467,7 @@ export default class ApolloClient implements DataProxy {
return result;
},
}));
};
}

/**
* Resets your entire store by clearing out your cache and then re-executing
Expand All @@ -489,7 +489,7 @@ export default class ApolloClient implements DataProxy {
if (this.queryManager) {
this.queryManager.resetStore();
}
};
}

public getInitialState(): { data: Object } {
this.initStore();
Expand Down Expand Up @@ -523,7 +523,7 @@ export default class ApolloClient implements DataProxy {
queryDeduplication: this.queryDeduplication,
fragmentMatcher: this.fragmentMatcher,
});
};
}

/**
* Initializes a data proxy for this client instance if one does not already
Expand Down
2 changes: 1 addition & 1 deletion src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface MutationErrorAction {
type: 'APOLLO_MUTATION_ERROR';
error: Error;
mutationId: string;
};
}

export function isMutationErrorAction(action: ApolloAction): action is MutationErrorAction {
return action.type === 'APOLLO_MUTATION_ERROR';
Expand Down
6 changes: 3 additions & 3 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export class QueryManager {
throw new ApolloError({
networkError: error,
});
};
}
});

if (fetchPolicy !== 'cache-and-network') {
Expand Down Expand Up @@ -702,7 +702,7 @@ export class QueryManager {
type: 'APOLLO_QUERY_STOP',
queryId,
});
};
}

public getApolloState(): Store {
return this.reduxRootSelector(this.store.getState());
Expand Down Expand Up @@ -882,7 +882,7 @@ export class QueryManager {
_networkSubscriptionId: subId,
} as Subscription;
});
};
}

public stopQuery(queryId: string) {
// XXX in the future if we should cancel the request
Expand Down
2 changes: 1 addition & 1 deletion src/core/watchQueryOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export type SubscribeToMoreOptions = {
export interface SubscriptionOptions {
query: DocumentNode;
variables?: { [key: string]: any };
};
}

export interface MutationOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/data/fragmentMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ export class HeuristicFragmentMatcher implements FragmentMatcherInterface {
// difference, so for now, we just do our best to resolve the fragment but turn on partial data
context.returnPartialData = true;
return true;
};
}
}
2 changes: 1 addition & 1 deletion src/data/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface DataProxyWriteQueryOptions {
* Any variables that the GraphQL query may depend on.
*/
variables?: Object;
};
}

export interface DataProxyWriteFragmentOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export {
Subscription,
SubscriptionOptions,
ApolloStore,
ApolloClient
ApolloClient,
};

export default ApolloClient;
6 changes: 3 additions & 3 deletions src/transport/batchedNetworkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface BatchRequestAndOptions {
export interface BatchResponseAndOptions {
responses: Response[];
options: RequestInit;
};
}

// An implementation of the network interface that operates over HTTP and batches
// together requests over the HTTP transport. Note that this implementation will only work correctly
Expand All @@ -57,7 +57,7 @@ export class HTTPBatchedNetworkInterface extends BaseNetworkInterface {
batchInterval: batchInterval,
batchFetchFunction: this.batchQuery.bind(this),
});
};
}

public query(request: Request): Promise<ExecutionResult> {
// we just pass it through to the batcher.
Expand Down Expand Up @@ -212,7 +212,7 @@ export class HTTPBatchedNetworkInterface extends BaseNetworkInterface {
...(options.headers as { [headerName: string]: string }),
},
});
};
}
}

export interface BatchingNetworkInterfaceOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/transport/batching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface QueryFetchRequest {
promise?: Promise<ExecutionResult>;
resolve?: (result: ExecutionResult) => void;
reject?: (error: Error) => void;
};
}

// QueryBatcher doesn't fire requests immediately. Requests that were enqueued within
// a certain amount of time (configurable through `batchInterval`) will be batched together
Expand Down
4 changes: 2 additions & 2 deletions src/transport/networkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class HTTPFetchNetworkInterface extends BaseNetworkInterface {
...(options.headers as { [headerName: string]: string }),
},
});
};
}

public query(request: Request): Promise<ExecutionResult> {
const options = { ...this._opts };
Expand Down Expand Up @@ -216,7 +216,7 @@ export class HTTPFetchNetworkInterface extends BaseNetworkInterface {
return payload as ExecutionResult;
}
});
};
}

public use(middlewares: MiddlewareInterface[]): HTTPNetworkInterface {
middlewares.map((middleware) => {
Expand Down
2 changes: 1 addition & 1 deletion src/util/maybeDeepFreeze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function deepFreeze (o: any) {
});

return o;
};
}

export default function maybeDeepFreeze(obj: any) {
if (isDevelopment() || isTest()) {
Expand Down
2 changes: 1 addition & 1 deletion test/fetchMore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('fetchMore on an observable query', () => {
});

return Promise.resolve(obsHandle);
};
}

function unsetup() {
sub.unsubscribe();
Expand Down
2 changes: 1 addition & 1 deletion test/graphqlSubscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('GraphQL Subscriptions', () => {
}) as any;

// Subscribe again. Should also receive the same result.
obs.subscribe({
const resub = obs.subscribe({
next(result) {
assert.deepEqual(result, results[0].result);
counter++;
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/mockNetworkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class MockSubscriptionNetworkInterface extends MockNetworkInterface imple
throw new Error('Network interface does not have subscription associated with this request.');
}

};
}

public fireResult(id: number) {
const handler = this.handlersById[id];
Expand Down
2 changes: 1 addition & 1 deletion test/mutationResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe('mutation results', () => {
function setup(...mockedResponses: any[]) {
const obsHandle = setupObsHandle(...mockedResponses);
return obsHandle.result();
};
}

it('correctly primes cache for tests', () => {
return setup()
Expand Down
4 changes: 2 additions & 2 deletions test/networkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function TestWare(
next();
},
};
};
}

// simulate afterware by altering variables and options
function TestAfterWare(
Expand All @@ -525,4 +525,4 @@ function TestAfterWare(
next();
},
};
};
}
4 changes: 2 additions & 2 deletions test/optimistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('optimistic mutation results', () => {
});

return obsHandle.result();
};
}

describe('error handling', () => {
const mutation = gql`
Expand Down Expand Up @@ -1564,7 +1564,7 @@ describe('optimistic mutation - githunt comments', () => {
});

return obsHandle.result();
};
}

const mutation = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
Expand Down
2 changes: 1 addition & 1 deletion test/util/observableToPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function observableToPromiseAndSubscription({
promise,
subscription,
};
};
}

export default function(
options: Options,
Expand Down
2 changes: 1 addition & 1 deletion test/util/subscribeAndCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export default function subscribeAndCount(done: MochaDone, observable: Observabl
error: done,
});
return subscription;
};
}

0 comments on commit c089cd8

Please sign in to comment.