@graphql-eslint/eslint-plugin 3.8.0-alpha-fb12b01.0 → 3.8.0-alpha-8ddf2a4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/parser.md CHANGED
@@ -36,7 +36,7 @@ Here's a list of changes that the parser performs, in order to make the GraphQL
36
36
 
37
37
  **Problem**: GraphQL uses `location` field to store the AST locations, while ESTree also uses it in a different structure.
38
38
 
39
- **Solution**: The parser creates a new `location` field that is compatible with ESTree, and renames the GraphQL `location` to `gqlLocation`.
39
+ **Solution**: The parser creates a new `location` field that is compatible with ESTree.
40
40
 
41
41
  ### Loading GraphQL Schema
42
42
 
@@ -1,5 +1,7 @@
1
1
  # `alphabetize`
2
2
 
3
+ 🔧 The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
4
+
3
5
  - Category: `Schema & Operations`
4
6
  - Rule name: `@graphql-eslint/alphabetize`
5
7
  - Requires GraphQL Schema: `false` [â„šī¸](../../README.md#extended-linting-rules-with-graphql-schema)
@@ -1,4 +1,4 @@
1
- import { ASTNode, Location, TypeInfo, TypeNode, ValueNode } from 'graphql';
1
+ import { ASTNode, TypeInfo, TypeNode, ValueNode } from 'graphql';
2
2
  import { BaseNode } from 'estree';
3
3
  export declare type SafeGraphQLType<T extends ASTNode | ValueNode> = Omit<T extends {
4
4
  readonly type: TypeNode;
@@ -7,7 +7,6 @@ export declare type SafeGraphQLType<T extends ASTNode | ValueNode> = Omit<T exte
7
7
  } : T, 'loc'>;
8
8
  export declare type SingleESTreeNode<T, WithTypeInfo extends boolean> = T extends ASTNode | ValueNode ? SafeGraphQLType<T> & Pick<BaseNode, 'leadingComments' | 'loc' | 'range'> & {
9
9
  type: T['kind'];
10
- gqlLocation: Location;
11
10
  } & (WithTypeInfo extends true ? {
12
11
  typeInfo?: () => {
13
12
  argument?: ReturnType<TypeInfo['getArgument']>;
@@ -1,12 +1,15 @@
1
- import { Location, ValueNode, StringValueNode, ASTNode, GraphQLOutputType, GraphQLNamedType } from 'graphql';
2
- import { SourceLocation, Comment } from 'estree';
3
- import { GraphQLESTreeNode } from './estree-ast';
1
+ import { Location, ValueNode, StringValueNode, ASTNode, TokenKind, GraphQLOutputType, GraphQLNamedType, Token, Source } from 'graphql';
2
+ import type { Comment } from 'estree';
3
+ import type { AST } from 'eslint';
4
+ import type { GraphQLESTreeNode } from './estree-ast';
4
5
  export default function keyValMap<T, V>(list: ReadonlyArray<T>, keyFn: (item: T) => string, valFn: (item: T) => V): Record<string, V>;
5
6
  export declare function valueFromNode(valueNode: GraphQLESTreeNode<ValueNode>, variables?: Record<string, any>): any;
6
7
  export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
7
- export declare function convertRange(gqlLocation: Location): [number, number];
8
+ export declare function convertToken<T extends 'Line' | 'Block' | TokenKind>(token: Token, type: T): Omit<AST.Token, 'type'> & {
9
+ type: T;
10
+ };
11
+ export declare function extractTokens(source: Source): AST.Token[];
8
12
  export declare function extractCommentsFromAst(loc: Location): Comment[];
9
- export declare function convertLocation(gqlLocation: Location): SourceLocation;
10
13
  export declare function isNodeWithDescription<T extends ASTNode>(obj: T): obj is T & {
11
14
  readonly description?: StringValueNode;
12
15
  };