Skip to content

Commit

Permalink
Upgrade dependencies so lint & test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Mar 23, 2016
1 parent 479c158 commit 7af93d3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 31 deletions.
16 changes: 5 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty": 2,
"no-empty-class": 2,
"no-empty-character-class": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
Expand Down Expand Up @@ -63,7 +63,7 @@
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-empty-label": 2,
"no-labels": [2, {"allowLoop": true}],
"no-eq-null": 0,
"no-eval": 2,
"no-extend-native": 2,
Expand All @@ -72,7 +72,6 @@
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-iterator": 2,
"no-labels": 0,
"no-lone-blocks": 0,
"no-loop-func": 0,
"no-multi-spaces": 2,
Expand Down Expand Up @@ -140,7 +139,7 @@
2,
2,
{
"indentSwitchCase": true
"SwitchCase": 1
}
],
"brace-style": [
Expand Down Expand Up @@ -187,7 +186,6 @@
"no-ternary": 0,
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"no-wrap-func": 2,
"one-var": [
2,
"never"
Expand Down Expand Up @@ -217,10 +215,7 @@
}
],
"sort-vars": 0,
"space-after-keywords": [
2,
"always"
],
"keyword-spacing": 2,
"space-before-blocks": [
2,
"always"
Expand All @@ -240,15 +235,14 @@
"int32Hint": false
}
],
"space-return-throw-case": 2,
"space-unary-ops": [
2,
{
"words": true,
"nonwords": false
}
],
"spaced-line-comment": [
"spaced-comment": [
2,
"always"
],
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
"devDependencies": {
"babel": "5.8.3",
"babel-core": "5.8.3",
"babel-eslint": "4.0.5",
"chai": "3.0.0",
"chai-as-promised": "5.1.0",
"coveralls": "2.11.3",
"eslint": "0.24.0",
"flow-bin": "0.13.1",
"graphql": "0.4.2",
"babel-eslint": "5.0.0",
"chai": "3.5.0",
"chai-as-promised": "5.3.0",
"coveralls": "2.11.8",
"eslint": "2.2.0",
"flow-bin": "0.22.1",
"graphql": "0.4.18",
"isparta": "3.0.3",
"mocha": "2.2.5",
"sane": "1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/starWarsConnectionTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { StarWarsSchema } from './starWarsSchema.js';
import { graphql } from 'graphql';

// 80+ char lines are useful in describe/it, so ignore in this file.
/*eslint-disable max-len */
/* eslint-disable max-len */

describe('Star Wars connections', () => {
it('fetches the first ship of the rebels', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/starWarsMutationTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { StarWarsSchema } from './starWarsSchema.js';
import { graphql } from 'graphql';

// 80+ char lines are useful in describe/it, so ignore in this file.
/*eslint-disable max-len */
/* eslint-disable max-len */

describe('Star Wars mutations', () => {
it('mutates the data set', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/starWarsObjectIdentificationTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { StarWarsSchema } from './starWarsSchema.js';
import { graphql } from 'graphql';

// 80+ char lines are useful in describe/it, so ignore in this file.
/*eslint-disable max-len */
/* eslint-disable max-len */

describe('Star Wars object identification', () => {
it('fetches the ID and name of the rebels', async () => {
Expand Down
12 changes: 7 additions & 5 deletions src/connection/arrayconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export function connectionFromArraySlice<T>(
beforeOffset,
arrayLength
);
if (first != null) {
if (typeof first === 'number') {
endOffset = Math.min(
endOffset,
startOffset + first
);
}
if (last != null) {
if (typeof last === 'number') {
startOffset = Math.max(
startOffset,
endOffset - last
Expand All @@ -117,8 +117,10 @@ export function connectionFromArraySlice<T>(
pageInfo: {
startCursor: firstEdge ? firstEdge.cursor : null,
endCursor: lastEdge ? lastEdge.cursor : null,
hasPreviousPage: last != null ? startOffset > lowerBound : false,
hasNextPage: first != null ? endOffset < upperBound : false,
hasPreviousPage:
typeof last === 'number' ? startOffset > lowerBound : false,
hasNextPage:
typeof first === 'number' ? endOffset < upperBound : false,
},
};
}
Expand Down Expand Up @@ -176,7 +178,7 @@ export function getOffsetWithDefault(
cursor?: ?ConnectionCursor,
defaultOffset: number
): number {
if (cursor == null) {
if (typeof cursor !== 'string') {
return defaultOffset;
}
var offset = cursorToOffset(cursor);
Expand Down
6 changes: 3 additions & 3 deletions src/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function connectionDefinitions(
config: ConnectionConfig
): GraphQLConnectionDefinitions {
var {nodeType} = config;
var name = config.name != null ? config.name : nodeType.name;
var name = config.name || nodeType.name;
var edgeFields = config.edgeFields || {};
var connectionFields = config.connectionFields || {};
var resolveNode = config.resolveNode;
Expand All @@ -102,7 +102,7 @@ export function connectionDefinitions(
resolve: resolveCursor,
description: 'A cursor for use in pagination'
},
...resolveMaybeThunk(edgeFields)
...(resolveMaybeThunk(edgeFields): any)
}),
});

Expand All @@ -118,7 +118,7 @@ export function connectionDefinitions(
type: new GraphQLList(edgeType),
description: 'Information to aid in pagination.'
},
...resolveMaybeThunk(connectionFields)
...(resolveMaybeThunk(connectionFields): any)
}),
});

Expand Down
2 changes: 1 addition & 1 deletion src/mutation/__tests__/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

// 80+ char lines are useful in describe/it, so ignore in this file.
/*eslint-disable max-len */
/* eslint-disable max-len */

import { describe, it } from 'mocha';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion src/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function globalIdField(
description: 'The ID of an object',
type: new GraphQLNonNull(GraphQLID),
resolve: (obj, args, info) => toGlobalId(
typeName != null ? typeName : info.parentType.name,
typeName || info.parentType.name,
idFetcher ? idFetcher(obj, info) : obj.id
)
};
Expand Down

0 comments on commit 7af93d3

Please sign in to comment.