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

ESLint: enable more rules for TS code #2375

Merged
merged 1 commit into from
Jan 20, 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
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