Skip to content

Commit

Permalink
ESLint: enable bunch of TS lint rules (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jan 25, 2020
1 parent d5a1ba8 commit 23b427c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.yml
Expand Up @@ -461,7 +461,7 @@ overrides:
'@typescript-eslint/member-ordering': off # TODO consider
'@typescript-eslint/naming-convention': off # TODO consider
'@typescript-eslint/no-dynamic-delete': off
'@typescript-eslint/no-empty-interface': off # TODO error
'@typescript-eslint/no-empty-interface': error
'@typescript-eslint/no-explicit-any': off # TODO error
'@typescript-eslint/no-extra-non-null-assertion': error
'@typescript-eslint/no-extraneous-class': off # TODO consider
Expand Down Expand Up @@ -503,7 +503,7 @@ overrides:
'@typescript-eslint/triple-slash-reference': error
'@typescript-eslint/typedef': off
'@typescript-eslint/unbound-method': off # TODO consider
'@typescript-eslint/unified-signatures': off # TODO error
'@typescript-eslint/unified-signatures': error

# Extension Rules
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules
Expand Down
3 changes: 1 addition & 2 deletions src/type/definition.d.ts
Expand Up @@ -238,9 +238,8 @@ export function isNullableType(type: any): type is GraphQLNullableType;
export function assertNullableType(type: any): GraphQLNullableType;

export function getNullableType(type: void): undefined;
export function getNullableType<T extends GraphQLNullableType>(type: T): T;
export function getNullableType<T extends GraphQLNullableType>(
type: GraphQLNonNull<T>,
type: GraphQLNonNull<T> | T,
): T;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/type/definition.js
Expand Up @@ -474,8 +474,7 @@ export function assertNullableType(type: mixed): GraphQLNullableType {

/* eslint-disable no-redeclare */
declare function getNullableType(type: void | null): void;
declare function getNullableType<T: GraphQLNullableType>(type: T): T;
declare function getNullableType<T>(type: GraphQLNonNull<T>): T;
declare function getNullableType<T>(type: GraphQLNonNull<T> | T): T;
export function getNullableType(type) {
/* eslint-enable no-redeclare */
if (type) {
Expand Down
4 changes: 1 addition & 3 deletions src/utilities/buildClientSchema.d.ts
Expand Up @@ -2,8 +2,6 @@ import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';

import { IntrospectionQuery } from './getIntrospectionQuery';

interface Options extends GraphQLSchemaValidationOptions {}

/**
* Build a GraphQLSchema for use by client tools.
*
Expand All @@ -18,5 +16,5 @@ interface Options extends GraphQLSchemaValidationOptions {}
*/
export function buildClientSchema(
introspection: IntrospectionQuery,
options?: Options,
options?: GraphQLSchemaValidationOptions,
): GraphQLSchema;
6 changes: 1 addition & 5 deletions src/utilities/buildClientSchema.js
Expand Up @@ -52,10 +52,6 @@ import {
type IntrospectionNamedTypeRef,
} from './getIntrospectionQuery';

type Options = {|
...GraphQLSchemaValidationOptions,
|};

/**
* Build a GraphQLSchema for use by client tools.
*
Expand All @@ -70,7 +66,7 @@ type Options = {|
*/
export function buildClientSchema(
introspection: IntrospectionQuery,
options?: Options,
options?: GraphQLSchemaValidationOptions,
): GraphQLSchema {
devAssert(
isObjectLike(introspection) && isObjectLike(introspection.__schema),
Expand Down

0 comments on commit 23b427c

Please sign in to comment.