Skip to content

Commit

Permalink
ESLint: enable more rules for TS code (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored Jan 20, 2020
1 parent d4c82e0 commit f0c717c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,6 @@ overrides:
import/no-deprecated: off
import/no-unresolved: off
import/export: off
no-undef: off

import/first: off
import/order: off
import/no-useless-path-segments: off
lines-between-class-members: off

# Extension Rules
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules
Expand Down
6 changes: 3 additions & 3 deletions src/language/printLocation.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Location } from '../language/ast';
import { Source } from '../language/source';
import { SourceLocation } from '../language/location';
import { Location } from './ast';
import { Source } from './source';
import { SourceLocation } from './location';

/**
* Render a helpful description of the location in the GraphQL Source document.
Expand Down
2 changes: 2 additions & 0 deletions src/tsutils/Maybe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/
type Maybe<T> = null | undefined | T;

// See https://github.com/typescript-eslint/typescript-eslint/issues/131
// eslint-disable-next-line no-undef
export default Maybe;
1 change: 1 addition & 0 deletions src/type/definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ export class GraphQLObjectType<
constructor(
config: Readonly<GraphQLObjectTypeConfig<TSource, TContext, TArgs>>,
);

getFields(): GraphQLFieldMap<any, TContext, TArgs>;
getInterfaces(): GraphQLInterfaceType[];

Expand Down
4 changes: 3 additions & 1 deletion src/type/directives.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Maybe from '../tsutils/Maybe';
import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition';

import { DirectiveDefinitionNode } from '../language/ast';
import { DirectiveLocationEnum } from '../language/directiveLocation';

import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition';

/**
* Test if the given value is a GraphQL directive.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/utilities/buildClientSchema.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IntrospectionQuery } from './getIntrospectionQuery';
import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';

import { IntrospectionQuery } from './getIntrospectionQuery';

interface Options extends GraphQLSchemaValidationOptions {}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/validation/validate.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import Maybe from '../tsutils/Maybe';

import { GraphQLError } from '../error/GraphQLError';

import { DocumentNode } from '../language/ast';

import { GraphQLSchema } from '../type/schema';

import { TypeInfo } from '../utilities/TypeInfo';

import { ValidationRule, SDLValidationRule } from './ValidationContext';
import Maybe from '../tsutils/Maybe';

/**
* Implements the "Validation" section of the spec.
Expand Down

0 comments on commit f0c717c

Please sign in to comment.