@graphql-eslint/eslint-plugin 3.16.2-alpha-20230322112454-cb28ba7 → 3.16.2-alpha-20230322145450-ffe6eec

Sign up to get free protection for your applications and to get access to all the features.
package/cjs/utils.js CHANGED
@@ -127,5 +127,6 @@ function getNodeName(node) {
127
127
  case graphql_1.Kind.OPERATION_DEFINITION:
128
128
  return node.name ? `${node.operation} "${node.name.value}"` : node.operation;
129
129
  }
130
+ return '';
130
131
  }
131
132
  exports.getNodeName = getNodeName;
package/esm/utils.js CHANGED
@@ -113,4 +113,5 @@ export function getNodeName(node) {
113
113
  case Kind.OPERATION_DEFINITION:
114
114
  return node.name ? `${node.operation} "${node.name.value}"` : node.operation;
115
115
  }
116
+ return '';
116
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.16.2-alpha-20230322112454-cb28ba7",
3
+ "version": "3.16.2-alpha-20230322145450-ffe6eec",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -1,3 +1,3 @@
1
1
  import { DocumentNode, GraphQLSchema } from 'graphql';
2
2
  import { GraphQLESTreeNode } from './types.cjs';
3
- export declare function convertToESTree<T extends DocumentNode>(node: T, schema?: GraphQLSchema | null): GraphQLESTreeNode<T, false>;
3
+ export declare function convertToESTree<T extends DocumentNode>(node: T, schema?: GraphQLSchema | null): GraphQLESTreeNode<T>;
@@ -1,3 +1,3 @@
1
1
  import { DocumentNode, GraphQLSchema } from 'graphql';
2
2
  import { GraphQLESTreeNode } from './types.js';
3
- export declare function convertToESTree<T extends DocumentNode>(node: T, schema?: GraphQLSchema | null): GraphQLESTreeNode<T, false>;
3
+ export declare function convertToESTree<T extends DocumentNode>(node: T, schema?: GraphQLSchema | null): GraphQLESTreeNode<T>;
@@ -7,19 +7,19 @@ export declare const rules: {
7
7
  fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[] | undefined;
8
8
  variables?: "OperationDefinition"[] | undefined;
9
9
  groups?: string[] | undefined;
10
- }[], false>;
10
+ }[]>;
11
11
  'description-style': import("../types.js").GraphQLESLintRule<{
12
12
  style?: "block" | "inline" | undefined;
13
- }[], false>;
13
+ }[]>;
14
14
  'input-name': import("../types.js").GraphQLESLintRule<{
15
15
  checkInputType?: boolean | undefined;
16
16
  caseSensitiveInputType?: boolean | undefined;
17
17
  checkQueries?: boolean | undefined;
18
18
  checkMutations?: boolean | undefined;
19
- }[], false>;
19
+ }[]>;
20
20
  'lone-executable-definition': import("../types.js").GraphQLESLintRule<{
21
21
  ignore?: ("fragment" | "query" | "mutation" | "subscription")[] | undefined;
22
- }[], false>;
22
+ }[]>;
23
23
  'match-document-filename': import("../types.js").GraphQLESLintRule<{
24
24
  fragment?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
25
25
  style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
@@ -42,7 +42,7 @@ export declare const rules: {
42
42
  prefix?: string | undefined;
43
43
  } | undefined;
44
44
  fileExtension?: ".gql" | ".graphql" | undefined;
45
- }[], false>;
45
+ }[]>;
46
46
  'naming-convention': import("../types.js").GraphQLESLintRule<{
47
47
  [x: string]: unknown;
48
48
  types?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | {
@@ -55,46 +55,46 @@ export declare const rules: {
55
55
  } | undefined;
56
56
  allowLeadingUnderscore?: boolean | undefined;
57
57
  allowTrailingUnderscore?: boolean | undefined;
58
- }[], false>;
59
- 'no-anonymous-operations': import("../types.js").GraphQLESLintRule<[], false>;
60
- 'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<[], false>;
58
+ }[]>;
59
+ 'no-anonymous-operations': import("../types.js").GraphQLESLintRule;
60
+ 'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule;
61
61
  'no-deprecated': import("../types.js").GraphQLESLintRule<[], true>;
62
- 'no-duplicate-fields': import("../types.js").GraphQLESLintRule<[], false>;
63
- 'no-hashtag-description': import("../types.js").GraphQLESLintRule<[], false>;
64
- 'no-one-place-fragments': import("../types.js").GraphQLESLintRule<[], false>;
62
+ 'no-duplicate-fields': import("../types.js").GraphQLESLintRule;
63
+ 'no-hashtag-description': import("../types.js").GraphQLESLintRule;
64
+ 'no-one-place-fragments': import("../types.js").GraphQLESLintRule;
65
65
  'no-root-type': import("../types.js").GraphQLESLintRule<{
66
66
  disallow: ("mutation" | "subscription")[];
67
- }[], false>;
68
- 'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<[], false>;
69
- 'no-typename-prefix': import("../types.js").GraphQLESLintRule<[], false>;
70
- 'no-unreachable-types': import("../types.js").GraphQLESLintRule<[], false>;
71
- 'no-unused-fields': import("../types.js").GraphQLESLintRule<[], false>;
67
+ }[]>;
68
+ 'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule;
69
+ 'no-typename-prefix': import("../types.js").GraphQLESLintRule;
70
+ 'no-unreachable-types': import("../types.js").GraphQLESLintRule;
71
+ 'no-unused-fields': import("../types.js").GraphQLESLintRule;
72
72
  'relay-arguments': import("../types.js").GraphQLESLintRule<{
73
73
  includeBoth?: boolean | undefined;
74
74
  }[], true>;
75
- 'relay-connection-types': import("../types.js").GraphQLESLintRule<[], false>;
75
+ 'relay-connection-types': import("../types.js").GraphQLESLintRule;
76
76
  'relay-edge-types': import("../types.js").GraphQLESLintRule<{
77
77
  withEdgeSuffix?: boolean | undefined;
78
78
  shouldImplementNode?: boolean | undefined;
79
79
  listTypeCanWrapOnlyEdgeType?: boolean | undefined;
80
80
  }[], true>;
81
- 'relay-page-info': import("../types.js").GraphQLESLintRule<[], false>;
81
+ 'relay-page-info': import("../types.js").GraphQLESLintRule;
82
82
  'require-deprecation-date': import("../types.js").GraphQLESLintRule<{
83
83
  argumentName?: string | undefined;
84
- }[], false>;
85
- 'require-deprecation-reason': import("../types.js").GraphQLESLintRule<[], false>;
86
- 'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions, false>;
87
- 'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<[], false>;
84
+ }[]>;
85
+ 'require-deprecation-reason': import("../types.js").GraphQLESLintRule;
86
+ 'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions>;
87
+ 'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule;
88
88
  'require-id-when-available': import("../types.js").GraphQLESLintRule<{
89
89
  fieldName?: string | string[] | undefined;
90
90
  }[], true>;
91
- 'require-import-fragment': import("../types.js").GraphQLESLintRule<[], false>;
92
- 'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
93
- 'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
91
+ 'require-import-fragment': import("../types.js").GraphQLESLintRule;
92
+ 'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule;
93
+ 'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule;
94
94
  'selection-set-depth': import("../types.js").GraphQLESLintRule<{
95
95
  ignore?: string[] | undefined;
96
96
  maxDepth: number;
97
- }[], false>;
97
+ }[]>;
98
98
  'strict-id-in-types': import("../types.js").GraphQLESLintRule<{
99
99
  acceptedIdNames?: string[] | undefined;
100
100
  acceptedIdTypes?: string[] | undefined;
@@ -102,7 +102,7 @@ export declare const rules: {
102
102
  types?: string[] | undefined;
103
103
  suffixes?: string[] | undefined;
104
104
  } | undefined;
105
- }[], false>;
106
- 'unique-fragment-name': import("../types.js").GraphQLESLintRule<[], false>;
107
- 'unique-operation-name': import("../types.js").GraphQLESLintRule<[], false>;
105
+ }[]>;
106
+ 'unique-fragment-name': import("../types.js").GraphQLESLintRule;
107
+ 'unique-operation-name': import("../types.js").GraphQLESLintRule;
108
108
  };
@@ -7,19 +7,19 @@ export declare const rules: {
7
7
  fields?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition">[] | undefined;
8
8
  variables?: "OperationDefinition"[] | undefined;
9
9
  groups?: string[] | undefined;
10
- }[], false>;
10
+ }[]>;
11
11
  'description-style': import("../types.js").GraphQLESLintRule<{
12
12
  style?: "block" | "inline" | undefined;
13
- }[], false>;
13
+ }[]>;
14
14
  'input-name': import("../types.js").GraphQLESLintRule<{
15
15
  checkInputType?: boolean | undefined;
16
16
  caseSensitiveInputType?: boolean | undefined;
17
17
  checkQueries?: boolean | undefined;
18
18
  checkMutations?: boolean | undefined;
19
- }[], false>;
19
+ }[]>;
20
20
  'lone-executable-definition': import("../types.js").GraphQLESLintRule<{
21
21
  ignore?: ("fragment" | "query" | "mutation" | "subscription")[] | undefined;
22
- }[], false>;
22
+ }[]>;
23
23
  'match-document-filename': import("../types.js").GraphQLESLintRule<{
24
24
  fragment?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | {
25
25
  style?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<import("../utils.js").CaseStyle | "matchDocumentStyle"> | undefined;
@@ -42,7 +42,7 @@ export declare const rules: {
42
42
  prefix?: string | undefined;
43
43
  } | undefined;
44
44
  fileExtension?: ".gql" | ".graphql" | undefined;
45
- }[], false>;
45
+ }[]>;
46
46
  'naming-convention': import("../types.js").GraphQLESLintRule<{
47
47
  [x: string]: unknown;
48
48
  types?: import("json-schema-to-ts/lib/types/type-utils/writable.js").DeepWritable<"camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE"> | {
@@ -55,46 +55,46 @@ export declare const rules: {
55
55
  } | undefined;
56
56
  allowLeadingUnderscore?: boolean | undefined;
57
57
  allowTrailingUnderscore?: boolean | undefined;
58
- }[], false>;
59
- 'no-anonymous-operations': import("../types.js").GraphQLESLintRule<[], false>;
60
- 'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule<[], false>;
58
+ }[]>;
59
+ 'no-anonymous-operations': import("../types.js").GraphQLESLintRule;
60
+ 'no-case-insensitive-enum-values-duplicates': import("../types.js").GraphQLESLintRule;
61
61
  'no-deprecated': import("../types.js").GraphQLESLintRule<[], true>;
62
- 'no-duplicate-fields': import("../types.js").GraphQLESLintRule<[], false>;
63
- 'no-hashtag-description': import("../types.js").GraphQLESLintRule<[], false>;
64
- 'no-one-place-fragments': import("../types.js").GraphQLESLintRule<[], false>;
62
+ 'no-duplicate-fields': import("../types.js").GraphQLESLintRule;
63
+ 'no-hashtag-description': import("../types.js").GraphQLESLintRule;
64
+ 'no-one-place-fragments': import("../types.js").GraphQLESLintRule;
65
65
  'no-root-type': import("../types.js").GraphQLESLintRule<{
66
66
  disallow: ("mutation" | "subscription")[];
67
- }[], false>;
68
- 'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule<[], false>;
69
- 'no-typename-prefix': import("../types.js").GraphQLESLintRule<[], false>;
70
- 'no-unreachable-types': import("../types.js").GraphQLESLintRule<[], false>;
71
- 'no-unused-fields': import("../types.js").GraphQLESLintRule<[], false>;
67
+ }[]>;
68
+ 'no-scalar-result-type-on-mutation': import("../types.js").GraphQLESLintRule;
69
+ 'no-typename-prefix': import("../types.js").GraphQLESLintRule;
70
+ 'no-unreachable-types': import("../types.js").GraphQLESLintRule;
71
+ 'no-unused-fields': import("../types.js").GraphQLESLintRule;
72
72
  'relay-arguments': import("../types.js").GraphQLESLintRule<{
73
73
  includeBoth?: boolean | undefined;
74
74
  }[], true>;
75
- 'relay-connection-types': import("../types.js").GraphQLESLintRule<[], false>;
75
+ 'relay-connection-types': import("../types.js").GraphQLESLintRule;
76
76
  'relay-edge-types': import("../types.js").GraphQLESLintRule<{
77
77
  withEdgeSuffix?: boolean | undefined;
78
78
  shouldImplementNode?: boolean | undefined;
79
79
  listTypeCanWrapOnlyEdgeType?: boolean | undefined;
80
80
  }[], true>;
81
- 'relay-page-info': import("../types.js").GraphQLESLintRule<[], false>;
81
+ 'relay-page-info': import("../types.js").GraphQLESLintRule;
82
82
  'require-deprecation-date': import("../types.js").GraphQLESLintRule<{
83
83
  argumentName?: string | undefined;
84
- }[], false>;
85
- 'require-deprecation-reason': import("../types.js").GraphQLESLintRule<[], false>;
86
- 'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions, false>;
87
- 'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule<[], false>;
84
+ }[]>;
85
+ 'require-deprecation-reason': import("../types.js").GraphQLESLintRule;
86
+ 'require-description': import("../types.js").GraphQLESLintRule<import("./require-description.js").RuleOptions>;
87
+ 'require-field-of-type-query-in-mutation-result': import("../types.js").GraphQLESLintRule;
88
88
  'require-id-when-available': import("../types.js").GraphQLESLintRule<{
89
89
  fieldName?: string | string[] | undefined;
90
90
  }[], true>;
91
- 'require-import-fragment': import("../types.js").GraphQLESLintRule<[], false>;
92
- 'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
93
- 'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule<[], false>;
91
+ 'require-import-fragment': import("../types.js").GraphQLESLintRule;
92
+ 'require-nullable-fields-with-oneof': import("../types.js").GraphQLESLintRule;
93
+ 'require-type-pattern-with-oneof': import("../types.js").GraphQLESLintRule;
94
94
  'selection-set-depth': import("../types.js").GraphQLESLintRule<{
95
95
  ignore?: string[] | undefined;
96
96
  maxDepth: number;
97
- }[], false>;
97
+ }[]>;
98
98
  'strict-id-in-types': import("../types.js").GraphQLESLintRule<{
99
99
  acceptedIdNames?: string[] | undefined;
100
100
  acceptedIdTypes?: string[] | undefined;
@@ -102,7 +102,7 @@ export declare const rules: {
102
102
  types?: string[] | undefined;
103
103
  suffixes?: string[] | undefined;
104
104
  } | undefined;
105
- }[], false>;
106
- 'unique-fragment-name': import("../types.js").GraphQLESLintRule<[], false>;
107
- 'unique-operation-name': import("../types.js").GraphQLESLintRule<[], false>;
105
+ }[]>;
106
+ 'unique-fragment-name': import("../types.js").GraphQLESLintRule;
107
+ 'unique-operation-name': import("../types.js").GraphQLESLintRule;
108
108
  };
@@ -3,6 +3,7 @@ import { Position } from 'estree';
3
3
  import { ASTNode, GraphQLSchema, Kind } from 'graphql';
4
4
  import { SiblingOperations } from './siblings.cjs';
5
5
  import { GraphQLESLintRuleContext } from './types.cjs';
6
+ import { GraphQLESTreeNode } from './estree-converter/index.cjs';
6
7
  export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
7
8
  export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
8
9
  export declare const logger: {
@@ -35,5 +36,5 @@ export declare const ARRAY_DEFAULT_OPTIONS: {
35
36
  export declare const englishJoinWords: (words: string[]) => string;
36
37
  type Truthy<T> = T extends '' | 0 | false | null | undefined ? never : T;
37
38
  export declare function truthy<T>(value: T): value is Truthy<T>;
38
- export declare function getNodeName(node: any): any;
39
+ export declare function getNodeName(node: GraphQLESTreeNode<ASTNode>): string;
39
40
  export {};
@@ -3,6 +3,7 @@ import { Position } from 'estree';
3
3
  import { ASTNode, GraphQLSchema, Kind } from 'graphql';
4
4
  import { SiblingOperations } from './siblings.js';
5
5
  import { GraphQLESLintRuleContext } from './types.js';
6
+ import { GraphQLESTreeNode } from './estree-converter/index.js';
6
7
  export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
7
8
  export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
8
9
  export declare const logger: {
@@ -35,5 +36,5 @@ export declare const ARRAY_DEFAULT_OPTIONS: {
35
36
  export declare const englishJoinWords: (words: string[]) => string;
36
37
  type Truthy<T> = T extends '' | 0 | false | null | undefined ? never : T;
37
38
  export declare function truthy<T>(value: T): value is Truthy<T>;
38
- export declare function getNodeName(node: any): any;
39
+ export declare function getNodeName(node: GraphQLESTreeNode<ASTNode>): string;
39
40
  export {};