Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow: enable 'sketchy-null-string' check #256

Merged
merged 1 commit into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dot-location": [2, "property"],
"dot-notation": 0,
"eol-last": 2,
"eqeqeq": 2,
"eqeqeq": [2, "smart"],
"func-names": 0,
"func-style": 0,
"generator-star-spacing": [2, { "before": true, "after": false }],
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[lints]
sketchy-null-bool=error
sketchy-null-string=off
sketchy-null-string=error
sketchy-null-number=error
sketchy-null-mixed=error
sketchy-number=error
Expand Down
4 changes: 2 additions & 2 deletions src/connection/arrayconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export function connectionFromArraySlice<T>(

const firstEdge = edges[0];
const lastEdge = edges[edges.length - 1];
const lowerBound = after ? afterOffset + 1 : 0;
const upperBound = before ? beforeOffset : arrayLength;
const lowerBound = after != null ? afterOffset + 1 : 0;
const upperBound = before != null ? beforeOffset : arrayLength;
return {
edges,
pageInfo: {
Expand Down
6 changes: 3 additions & 3 deletions src/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export function connectionDefinitions(
config: ConnectionConfig,
): GraphQLConnectionDefinitions {
const { nodeType } = config;
const name = config.name || nodeType.name;
const edgeFields = config.edgeFields || {};
const connectionFields = config.connectionFields || {};
const name = config.name ?? nodeType.name;
const edgeFields = config.edgeFields ?? {};
const connectionFields = config.connectionFields ?? {};
const resolveNode = config.resolveNode;
const resolveCursor = config.resolveCursor;
const edgeType = new GraphQLObjectType({
Expand Down
2 changes: 1 addition & 1 deletion src/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function globalIdField(
type: new GraphQLNonNull(GraphQLID),
resolve: (obj, args, context, info) =>
toGlobalId(
typeName || info.parentType.name,
typeName ?? info.parentType.name,
idFetcher ? idFetcher(obj, context, info) : obj.id,
),
};
Expand Down