@graphql-eslint/eslint-plugin 4.0.0-alpha.15 → 4.0.0-alpha.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/cjs/cache.js +1 -2
  2. package/cjs/configs/index.d.cts +427 -10
  3. package/cjs/configs/index.js +1 -2
  4. package/cjs/configs/operations-all.d.cts +8 -8
  5. package/cjs/configs/operations-all.js +30 -33
  6. package/cjs/configs/operations-recommended.d.cts +35 -35
  7. package/cjs/configs/operations-recommended.js +56 -59
  8. package/cjs/configs/schema-all.d.cts +12 -12
  9. package/cjs/configs/schema-all.js +26 -29
  10. package/cjs/configs/schema-recommended.d.cts +23 -23
  11. package/cjs/configs/schema-recommended.js +70 -73
  12. package/cjs/configs/schema-relay.d.cts +5 -5
  13. package/cjs/configs/schema-relay.js +14 -17
  14. package/cjs/documents.js +1 -2
  15. package/cjs/estree-converter/converter.js +1 -2
  16. package/cjs/estree-converter/utils.js +1 -2
  17. package/cjs/graphql-config.js +1 -2
  18. package/cjs/index.d.cts +433 -15
  19. package/cjs/index.js +1 -2
  20. package/cjs/meta.js +1 -2
  21. package/cjs/parser.js +1 -2
  22. package/cjs/processor.js +1 -2
  23. package/cjs/rules/alphabetize/index.js +1 -2
  24. package/cjs/rules/description-style/index.js +1 -2
  25. package/cjs/rules/graphql-js-validation.js +1 -2
  26. package/cjs/rules/index.d.cts +4 -4
  27. package/cjs/rules/index.js +1 -2
  28. package/cjs/rules/input-name/index.js +1 -2
  29. package/cjs/rules/lone-executable-definition/index.js +1 -2
  30. package/cjs/rules/match-document-filename/index.js +1 -2
  31. package/cjs/rules/naming-convention/index.js +1 -2
  32. package/cjs/rules/no-anonymous-operations/index.js +1 -2
  33. package/cjs/rules/no-deprecated/index.js +1 -2
  34. package/cjs/rules/no-duplicate-fields/index.js +1 -2
  35. package/cjs/rules/no-hashtag-description/index.js +1 -2
  36. package/cjs/rules/no-one-place-fragments/index.js +1 -2
  37. package/cjs/rules/no-root-type/index.js +1 -2
  38. package/cjs/rules/no-scalar-result-type-on-mutation/index.js +1 -2
  39. package/cjs/rules/no-typename-prefix/index.js +1 -2
  40. package/cjs/rules/no-unreachable-types/index.js +1 -2
  41. package/cjs/rules/no-unused-fields/index.js +1 -2
  42. package/cjs/rules/relay-arguments/index.js +1 -2
  43. package/cjs/rules/relay-connection-types/index.js +1 -2
  44. package/cjs/rules/relay-edge-types/index.js +1 -2
  45. package/cjs/rules/relay-page-info/index.js +1 -2
  46. package/cjs/rules/require-deprecation-date/index.js +1 -2
  47. package/cjs/rules/require-deprecation-reason/index.js +1 -2
  48. package/cjs/rules/require-description/index.js +1 -2
  49. package/cjs/rules/require-field-of-type-query-in-mutation-result/index.js +1 -2
  50. package/cjs/rules/require-import-fragment/index.js +1 -2
  51. package/cjs/rules/require-nullable-fields-with-oneof/index.js +1 -2
  52. package/cjs/rules/require-nullable-result-in-root/index.js +1 -2
  53. package/cjs/rules/require-selections/index.js +1 -2
  54. package/cjs/rules/require-type-pattern-with-oneof/index.js +1 -2
  55. package/cjs/rules/selection-set-depth/index.js +1 -2
  56. package/cjs/rules/strict-id-in-types/index.js +1 -2
  57. package/cjs/rules/unique-enum-value-names/index.js +1 -2
  58. package/cjs/rules/unique-fragment-name/index.js +1 -2
  59. package/cjs/rules/unique-operation-name/index.js +1 -2
  60. package/cjs/schema.js +1 -2
  61. package/cjs/siblings.js +1 -2
  62. package/cjs/utils.js +1 -2
  63. package/esm/cache.js +0 -1
  64. package/esm/configs/index.d.ts +427 -10
  65. package/esm/configs/index.js +0 -1
  66. package/esm/configs/operations-all.d.ts +7 -7
  67. package/esm/configs/operations-all.js +28 -33
  68. package/esm/configs/operations-recommended.d.ts +34 -34
  69. package/esm/configs/operations-recommended.js +54 -59
  70. package/esm/configs/schema-all.d.ts +11 -11
  71. package/esm/configs/schema-all.js +24 -29
  72. package/esm/configs/schema-recommended.d.ts +22 -22
  73. package/esm/configs/schema-recommended.js +68 -73
  74. package/esm/configs/schema-relay.d.ts +4 -4
  75. package/esm/configs/schema-relay.js +12 -17
  76. package/esm/documents.js +0 -1
  77. package/esm/estree-converter/converter.js +0 -1
  78. package/esm/estree-converter/utils.js +0 -1
  79. package/esm/graphql-config.js +0 -1
  80. package/esm/index.d.ts +433 -15
  81. package/esm/index.js +0 -1
  82. package/esm/meta.js +1 -2
  83. package/esm/parser.js +0 -1
  84. package/esm/processor.js +0 -1
  85. package/esm/rules/alphabetize/index.js +0 -1
  86. package/esm/rules/description-style/index.js +0 -1
  87. package/esm/rules/graphql-js-validation.js +0 -1
  88. package/esm/rules/index.d.ts +4 -4
  89. package/esm/rules/index.js +0 -1
  90. package/esm/rules/input-name/index.js +0 -1
  91. package/esm/rules/lone-executable-definition/index.js +0 -1
  92. package/esm/rules/match-document-filename/index.js +0 -1
  93. package/esm/rules/naming-convention/index.js +0 -1
  94. package/esm/rules/no-anonymous-operations/index.js +0 -1
  95. package/esm/rules/no-deprecated/index.js +0 -1
  96. package/esm/rules/no-duplicate-fields/index.js +0 -1
  97. package/esm/rules/no-hashtag-description/index.js +0 -1
  98. package/esm/rules/no-one-place-fragments/index.js +0 -1
  99. package/esm/rules/no-root-type/index.js +0 -1
  100. package/esm/rules/no-scalar-result-type-on-mutation/index.js +0 -1
  101. package/esm/rules/no-typename-prefix/index.js +0 -1
  102. package/esm/rules/no-unreachable-types/index.js +0 -1
  103. package/esm/rules/no-unused-fields/index.js +0 -1
  104. package/esm/rules/relay-arguments/index.js +0 -1
  105. package/esm/rules/relay-connection-types/index.js +0 -1
  106. package/esm/rules/relay-edge-types/index.js +0 -1
  107. package/esm/rules/relay-page-info/index.js +0 -1
  108. package/esm/rules/require-deprecation-date/index.js +0 -1
  109. package/esm/rules/require-deprecation-reason/index.js +0 -1
  110. package/esm/rules/require-description/index.js +0 -1
  111. package/esm/rules/require-field-of-type-query-in-mutation-result/index.js +0 -1
  112. package/esm/rules/require-import-fragment/index.js +0 -1
  113. package/esm/rules/require-nullable-fields-with-oneof/index.js +0 -1
  114. package/esm/rules/require-nullable-result-in-root/index.js +0 -1
  115. package/esm/rules/require-selections/index.js +0 -1
  116. package/esm/rules/require-type-pattern-with-oneof/index.js +0 -1
  117. package/esm/rules/selection-set-depth/index.js +0 -1
  118. package/esm/rules/strict-id-in-types/index.js +0 -1
  119. package/esm/rules/unique-enum-value-names/index.js +0 -1
  120. package/esm/rules/unique-fragment-name/index.js +0 -1
  121. package/esm/rules/unique-operation-name/index.js +0 -1
  122. package/esm/schema.js +0 -1
  123. package/esm/siblings.js +0 -1
  124. package/esm/utils.js +0 -1
  125. package/index.browser.js +203 -251
  126. package/package.json +1 -1
  127. package/cjs/chunk-UIAXBAMD.js +0 -8
  128. package/esm/chunk-UIAXBAMD.js +0 -8
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  const NO_TYPENAME_PREFIX = "NO_TYPENAME_PREFIX", rule = {
3
2
  meta: {
4
3
  type: "suggestion",
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import {
3
2
  DirectiveLocation,
4
3
  getNamedType,
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { TypeInfo, visit, visitWithTypeInfo } from "graphql";
3
2
  import { ModuleCache } from "../../cache.js";
4
3
  import { requireGraphQLSchemaFromContext, requireSiblingsOperations } from "../../utils.js";
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { isScalarType, Kind } from "graphql";
3
2
  import { requireGraphQLSchemaFromContext } from "../../utils.js";
4
3
  const RULE_ID = "relay-arguments", MISSING_ARGUMENTS = "MISSING_ARGUMENTS", schema = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  const MUST_BE_OBJECT_TYPE = "MUST_BE_OBJECT_TYPE", MUST_CONTAIN_FIELD_EDGES = "MUST_CONTAIN_FIELD_EDGES", MUST_CONTAIN_FIELD_PAGE_INFO = "MUST_CONTAIN_FIELD_PAGE_INFO", MUST_HAVE_CONNECTION_SUFFIX = "MUST_HAVE_CONNECTION_SUFFIX", EDGES_FIELD_MUST_RETURN_LIST_TYPE = "EDGES_FIELD_MUST_RETURN_LIST_TYPE", PAGE_INFO_FIELD_MUST_RETURN_NON_NULL_TYPE = "PAGE_INFO_FIELD_MUST_RETURN_NON_NULL_TYPE", NON_OBJECT_TYPES = [
4
3
  Kind.SCALAR_TYPE_DEFINITION,
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import {
3
2
  isObjectType,
4
3
  isScalarType,
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { isScalarType, Kind } from "graphql";
3
2
  import { REPORT_ON_FIRST_CHARACTER, requireGraphQLSchemaFromContext } from "../../utils.js";
4
3
  import { NON_OBJECT_TYPES } from "../relay-connection-types/index.js";
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { valueFromNode } from "../../estree-converter/index.js";
3
2
  import { getNodeName } from "../../utils.js";
4
3
  const DATE_REGEX = /^\d{2}\/\d{2}\/\d{4}$/, MESSAGE_REQUIRE_DATE = "MESSAGE_REQUIRE_DATE", MESSAGE_INVALID_FORMAT = "MESSAGE_INVALID_FORMAT", MESSAGE_INVALID_DATE = "MESSAGE_INVALID_DATE", MESSAGE_CAN_BE_REMOVED = "MESSAGE_CAN_BE_REMOVED", schema = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { valueFromNode } from "../../estree-converter/index.js";
3
2
  import { getNodeName } from "../../utils.js";
4
3
  const rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind, TokenKind } from "graphql";
3
2
  import { getRootTypeNames } from "@graphql-tools/utils";
4
3
  import {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { isObjectType } from "graphql";
3
2
  import { getTypeName, requireGraphQLSchemaFromContext } from "../../utils.js";
4
3
  const RULE_ID = "require-field-of-type-query-in-mutation-result", rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import path from "node:path";
3
2
  import { requireSiblingsOperations, slash } from "../../utils.js";
4
3
  const RULE_ID = "require-import-fragment", SUGGESTION_ID = "add-import-expression", rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import { getNodeName } from "../../utils.js";
4
3
  const RULE_ID = "require-nullable-fields-with-oneof", rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import { getNodeName, requireGraphQLSchemaFromContext, truthy } from "../../utils.js";
4
3
  const RULE_ID = "require-nullable-result-in-root", rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import {
3
2
  GraphQLInterfaceType,
4
3
  GraphQLObjectType,
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { displayNodeName } from "../../utils.js";
3
2
  const RULE_ID = "require-type-pattern-with-oneof", rule = {
4
3
  meta: {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import depthLimit from "graphql-depth-limit";
4
3
  import { ARRAY_DEFAULT_OPTIONS, logger, requireSiblingsOperations } from "../../utils.js";
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import {
4
3
  ARRAY_DEFAULT_OPTIONS,
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import { getNodeName } from "../../utils.js";
4
3
  const rule = {
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { relative } from "node:path";
3
2
  import { Kind } from "graphql";
4
3
  import { CWD, requireSiblingsOperations, slash, VIRTUAL_DOCUMENT_REGEX } from "../../utils.js";
@@ -1,4 +1,3 @@
1
- import "../../chunk-UIAXBAMD.js";
2
1
  import { checkNode } from "../unique-fragment-name/index.js";
3
2
  const RULE_ID = "unique-operation-name", rule = {
4
3
  meta: {
package/esm/schema.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./chunk-UIAXBAMD.js";
2
1
  import debugFactory from "debug";
3
2
  import fg from "fast-glob";
4
3
  import { GraphQLSchema } from "graphql";
package/esm/siblings.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./chunk-UIAXBAMD.js";
2
1
  import {
3
2
  Kind,
4
3
  visit
package/esm/utils.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./chunk-UIAXBAMD.js";
2
1
  import { Kind } from "graphql";
3
2
  import lowerCase from "lodash.lowercase";
4
3
  function requireSiblingsOperations(ruleId, context) {
package/index.browser.js CHANGED
@@ -1,241 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __commonJS = (cb, mod) => function() {
7
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- ));
23
-
24
- // src/configs/operations-all.ts
25
- var require_operations_all = __commonJS({
26
- "src/configs/operations-all.ts"(exports, module) {
27
- "use strict";
28
- module.exports = {
29
- extends: "./configs/operations-recommended",
30
- rules: {
31
- "@graphql-eslint/alphabetize": [
32
- "error",
33
- {
34
- definitions: !0,
35
- selections: ["OperationDefinition", "FragmentDefinition"],
36
- variables: !0,
37
- arguments: ["Field", "Directive"],
38
- groups: ["...", "id", "*", "{"]
39
- }
40
- ],
41
- "@graphql-eslint/lone-executable-definition": "error",
42
- "@graphql-eslint/match-document-filename": [
43
- "error",
44
- {
45
- query: "kebab-case",
46
- mutation: "kebab-case",
47
- subscription: "kebab-case",
48
- fragment: "kebab-case"
49
- }
50
- ],
51
- "@graphql-eslint/no-one-place-fragments": "error",
52
- "@graphql-eslint/require-import-fragment": "error"
53
- }
54
- };
55
- }
56
- });
57
-
58
- // src/configs/operations-recommended.ts
59
- var require_operations_recommended = __commonJS({
60
- "src/configs/operations-recommended.ts"(exports, module) {
61
- "use strict";
62
- module.exports = {
63
- parser: "@graphql-eslint/eslint-plugin",
64
- plugins: ["@graphql-eslint"],
65
- rules: {
66
- "@graphql-eslint/executable-definitions": "error",
67
- "@graphql-eslint/fields-on-correct-type": "error",
68
- "@graphql-eslint/fragments-on-composite-type": "error",
69
- "@graphql-eslint/known-argument-names": "error",
70
- "@graphql-eslint/known-directives": "error",
71
- "@graphql-eslint/known-fragment-names": "error",
72
- "@graphql-eslint/known-type-names": "error",
73
- "@graphql-eslint/lone-anonymous-operation": "error",
74
- "@graphql-eslint/naming-convention": [
75
- "error",
76
- {
77
- VariableDefinition: "camelCase",
78
- OperationDefinition: {
79
- style: "PascalCase",
80
- forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
81
- forbiddenSuffixes: ["Query", "Mutation", "Subscription"]
82
- },
83
- FragmentDefinition: {
84
- style: "PascalCase",
85
- forbiddenPrefixes: ["Fragment"],
86
- forbiddenSuffixes: ["Fragment"]
87
- }
88
- }
89
- ],
90
- "@graphql-eslint/no-anonymous-operations": "error",
91
- "@graphql-eslint/no-deprecated": "error",
92
- "@graphql-eslint/no-duplicate-fields": "error",
93
- "@graphql-eslint/no-fragment-cycles": "error",
94
- "@graphql-eslint/no-undefined-variables": "error",
95
- "@graphql-eslint/no-unused-fragments": "error",
96
- "@graphql-eslint/no-unused-variables": "error",
97
- "@graphql-eslint/one-field-subscriptions": "error",
98
- "@graphql-eslint/overlapping-fields-can-be-merged": "error",
99
- "@graphql-eslint/possible-fragment-spread": "error",
100
- "@graphql-eslint/provided-required-arguments": "error",
101
- "@graphql-eslint/require-selections": "error",
102
- "@graphql-eslint/scalar-leafs": "error",
103
- "@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
104
- "@graphql-eslint/unique-argument-names": "error",
105
- "@graphql-eslint/unique-directive-names-per-location": "error",
106
- "@graphql-eslint/unique-fragment-name": "error",
107
- "@graphql-eslint/unique-input-field-names": "error",
108
- "@graphql-eslint/unique-operation-name": "error",
109
- "@graphql-eslint/unique-variable-names": "error",
110
- "@graphql-eslint/value-literals-of-correct-type": "error",
111
- "@graphql-eslint/variables-are-input-types": "error",
112
- "@graphql-eslint/variables-in-allowed-position": "error"
113
- }
114
- };
115
- }
116
- });
117
-
118
- // src/configs/schema-all.ts
119
- var require_schema_all = __commonJS({
120
- "src/configs/schema-all.ts"(exports, module) {
121
- "use strict";
122
- module.exports = {
123
- extends: "./configs/schema-recommended",
124
- rules: {
125
- "@graphql-eslint/alphabetize": [
126
- "error",
127
- {
128
- definitions: !0,
129
- fields: ["ObjectTypeDefinition", "InterfaceTypeDefinition", "InputObjectTypeDefinition"],
130
- values: !0,
131
- arguments: ["FieldDefinition", "Field", "DirectiveDefinition", "Directive"],
132
- groups: ["id", "*", "createdAt", "updatedAt"]
133
- }
134
- ],
135
- "@graphql-eslint/input-name": "error",
136
- "@graphql-eslint/no-root-type": ["error", { disallow: ["mutation", "subscription"] }],
137
- "@graphql-eslint/no-scalar-result-type-on-mutation": "error",
138
- "@graphql-eslint/require-deprecation-date": "error",
139
- "@graphql-eslint/require-field-of-type-query-in-mutation-result": "error",
140
- "@graphql-eslint/require-nullable-fields-with-oneof": "error",
141
- "@graphql-eslint/require-nullable-result-in-root": "error",
142
- "@graphql-eslint/require-type-pattern-with-oneof": "error"
143
- }
144
- };
145
- }
146
- });
147
-
148
- // src/configs/schema-recommended.ts
149
- var require_schema_recommended = __commonJS({
150
- "src/configs/schema-recommended.ts"(exports, module) {
151
- "use strict";
152
- module.exports = {
153
- parser: "@graphql-eslint/eslint-plugin",
154
- plugins: ["@graphql-eslint"],
155
- rules: {
156
- "@graphql-eslint/description-style": "error",
157
- "@graphql-eslint/known-argument-names": "error",
158
- "@graphql-eslint/known-directives": "error",
159
- "@graphql-eslint/known-type-names": "error",
160
- "@graphql-eslint/lone-schema-definition": "error",
161
- "@graphql-eslint/naming-convention": [
162
- "error",
163
- {
164
- types: "PascalCase",
165
- FieldDefinition: "camelCase",
166
- InputValueDefinition: "camelCase",
167
- Argument: "camelCase",
168
- DirectiveDefinition: "camelCase",
169
- EnumValueDefinition: "UPPER_CASE",
170
- "FieldDefinition[parent.name.value=Query]": {
171
- forbiddenPrefixes: ["query", "get"],
172
- forbiddenSuffixes: ["Query"]
173
- },
174
- "FieldDefinition[parent.name.value=Mutation]": {
175
- forbiddenPrefixes: ["mutation"],
176
- forbiddenSuffixes: ["Mutation"]
177
- },
178
- "FieldDefinition[parent.name.value=Subscription]": {
179
- forbiddenPrefixes: ["subscription"],
180
- forbiddenSuffixes: ["Subscription"]
181
- },
182
- "EnumTypeDefinition,EnumTypeExtension": {
183
- forbiddenPrefixes: ["Enum"],
184
- forbiddenSuffixes: ["Enum"]
185
- },
186
- "InterfaceTypeDefinition,InterfaceTypeExtension": {
187
- forbiddenPrefixes: ["Interface"],
188
- forbiddenSuffixes: ["Interface"]
189
- },
190
- "UnionTypeDefinition,UnionTypeExtension": {
191
- forbiddenPrefixes: ["Union"],
192
- forbiddenSuffixes: ["Union"]
193
- },
194
- "ObjectTypeDefinition,ObjectTypeExtension": {
195
- forbiddenPrefixes: ["Type"],
196
- forbiddenSuffixes: ["Type"]
197
- }
198
- }
199
- ],
200
- "@graphql-eslint/no-hashtag-description": "error",
201
- "@graphql-eslint/no-typename-prefix": "error",
202
- "@graphql-eslint/no-unreachable-types": "error",
203
- "@graphql-eslint/possible-type-extension": "error",
204
- "@graphql-eslint/provided-required-arguments": "error",
205
- "@graphql-eslint/require-deprecation-reason": "error",
206
- "@graphql-eslint/require-description": [
207
- "error",
208
- { types: !0, DirectiveDefinition: !0, rootField: !0 }
209
- ],
210
- "@graphql-eslint/strict-id-in-types": "error",
211
- "@graphql-eslint/unique-directive-names": "error",
212
- "@graphql-eslint/unique-directive-names-per-location": "error",
213
- "@graphql-eslint/unique-enum-value-names": "error",
214
- "@graphql-eslint/unique-field-definition-names": "error",
215
- "@graphql-eslint/unique-operation-types": "error",
216
- "@graphql-eslint/unique-type-names": "error"
217
- }
218
- };
219
- }
220
- });
221
-
222
- // src/configs/schema-relay.ts
223
- var require_schema_relay = __commonJS({
224
- "src/configs/schema-relay.ts"(exports, module) {
225
- "use strict";
226
- module.exports = {
227
- parser: "@graphql-eslint/eslint-plugin",
228
- plugins: ["@graphql-eslint"],
229
- rules: {
230
- "@graphql-eslint/relay-arguments": "error",
231
- "@graphql-eslint/relay-connection-types": "error",
232
- "@graphql-eslint/relay-edge-types": "error",
233
- "@graphql-eslint/relay-page-info": "error"
234
- }
235
- };
236
- }
237
- });
238
-
239
1
  // src/parser.ts
240
2
  import debugFactory2 from "debug";
241
3
  import { buildSchema, GraphQLError } from "graphql";
@@ -5467,32 +5229,222 @@ var rules = {
5467
5229
  "unique-operation-name": rule34
5468
5230
  };
5469
5231
 
5232
+ // src/configs/operations-all.ts
5233
+ var operations_all_default = {
5234
+ extends: "./configs/operations-recommended",
5235
+ rules: {
5236
+ "@graphql-eslint/alphabetize": [
5237
+ "error",
5238
+ {
5239
+ definitions: !0,
5240
+ selections: ["OperationDefinition", "FragmentDefinition"],
5241
+ variables: !0,
5242
+ arguments: ["Field", "Directive"],
5243
+ groups: ["...", "id", "*", "{"]
5244
+ }
5245
+ ],
5246
+ "@graphql-eslint/lone-executable-definition": "error",
5247
+ "@graphql-eslint/match-document-filename": [
5248
+ "error",
5249
+ {
5250
+ query: "kebab-case",
5251
+ mutation: "kebab-case",
5252
+ subscription: "kebab-case",
5253
+ fragment: "kebab-case"
5254
+ }
5255
+ ],
5256
+ "@graphql-eslint/no-one-place-fragments": "error",
5257
+ "@graphql-eslint/require-import-fragment": "error"
5258
+ }
5259
+ };
5260
+
5261
+ // src/configs/operations-recommended.ts
5262
+ var operations_recommended_default = {
5263
+ parser: "@graphql-eslint/eslint-plugin",
5264
+ plugins: ["@graphql-eslint"],
5265
+ rules: {
5266
+ "@graphql-eslint/executable-definitions": "error",
5267
+ "@graphql-eslint/fields-on-correct-type": "error",
5268
+ "@graphql-eslint/fragments-on-composite-type": "error",
5269
+ "@graphql-eslint/known-argument-names": "error",
5270
+ "@graphql-eslint/known-directives": "error",
5271
+ "@graphql-eslint/known-fragment-names": "error",
5272
+ "@graphql-eslint/known-type-names": "error",
5273
+ "@graphql-eslint/lone-anonymous-operation": "error",
5274
+ "@graphql-eslint/naming-convention": [
5275
+ "error",
5276
+ {
5277
+ VariableDefinition: "camelCase",
5278
+ OperationDefinition: {
5279
+ style: "PascalCase",
5280
+ forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
5281
+ forbiddenSuffixes: ["Query", "Mutation", "Subscription"]
5282
+ },
5283
+ FragmentDefinition: {
5284
+ style: "PascalCase",
5285
+ forbiddenPrefixes: ["Fragment"],
5286
+ forbiddenSuffixes: ["Fragment"]
5287
+ }
5288
+ }
5289
+ ],
5290
+ "@graphql-eslint/no-anonymous-operations": "error",
5291
+ "@graphql-eslint/no-deprecated": "error",
5292
+ "@graphql-eslint/no-duplicate-fields": "error",
5293
+ "@graphql-eslint/no-fragment-cycles": "error",
5294
+ "@graphql-eslint/no-undefined-variables": "error",
5295
+ "@graphql-eslint/no-unused-fragments": "error",
5296
+ "@graphql-eslint/no-unused-variables": "error",
5297
+ "@graphql-eslint/one-field-subscriptions": "error",
5298
+ "@graphql-eslint/overlapping-fields-can-be-merged": "error",
5299
+ "@graphql-eslint/possible-fragment-spread": "error",
5300
+ "@graphql-eslint/provided-required-arguments": "error",
5301
+ "@graphql-eslint/require-selections": "error",
5302
+ "@graphql-eslint/scalar-leafs": "error",
5303
+ "@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
5304
+ "@graphql-eslint/unique-argument-names": "error",
5305
+ "@graphql-eslint/unique-directive-names-per-location": "error",
5306
+ "@graphql-eslint/unique-fragment-name": "error",
5307
+ "@graphql-eslint/unique-input-field-names": "error",
5308
+ "@graphql-eslint/unique-operation-name": "error",
5309
+ "@graphql-eslint/unique-variable-names": "error",
5310
+ "@graphql-eslint/value-literals-of-correct-type": "error",
5311
+ "@graphql-eslint/variables-are-input-types": "error",
5312
+ "@graphql-eslint/variables-in-allowed-position": "error"
5313
+ }
5314
+ };
5315
+
5316
+ // src/configs/schema-all.ts
5317
+ var schema_all_default = {
5318
+ extends: "./configs/schema-recommended",
5319
+ rules: {
5320
+ "@graphql-eslint/alphabetize": [
5321
+ "error",
5322
+ {
5323
+ definitions: !0,
5324
+ fields: ["ObjectTypeDefinition", "InterfaceTypeDefinition", "InputObjectTypeDefinition"],
5325
+ values: !0,
5326
+ arguments: ["FieldDefinition", "Field", "DirectiveDefinition", "Directive"],
5327
+ groups: ["id", "*", "createdAt", "updatedAt"]
5328
+ }
5329
+ ],
5330
+ "@graphql-eslint/input-name": "error",
5331
+ "@graphql-eslint/no-root-type": ["error", { disallow: ["mutation", "subscription"] }],
5332
+ "@graphql-eslint/no-scalar-result-type-on-mutation": "error",
5333
+ "@graphql-eslint/require-deprecation-date": "error",
5334
+ "@graphql-eslint/require-field-of-type-query-in-mutation-result": "error",
5335
+ "@graphql-eslint/require-nullable-fields-with-oneof": "error",
5336
+ "@graphql-eslint/require-nullable-result-in-root": "error",
5337
+ "@graphql-eslint/require-type-pattern-with-oneof": "error"
5338
+ }
5339
+ };
5340
+
5341
+ // src/configs/schema-recommended.ts
5342
+ var schema_recommended_default = {
5343
+ parser: "@graphql-eslint/eslint-plugin",
5344
+ plugins: ["@graphql-eslint"],
5345
+ rules: {
5346
+ "@graphql-eslint/description-style": "error",
5347
+ "@graphql-eslint/known-argument-names": "error",
5348
+ "@graphql-eslint/known-directives": "error",
5349
+ "@graphql-eslint/known-type-names": "error",
5350
+ "@graphql-eslint/lone-schema-definition": "error",
5351
+ "@graphql-eslint/naming-convention": [
5352
+ "error",
5353
+ {
5354
+ types: "PascalCase",
5355
+ FieldDefinition: "camelCase",
5356
+ InputValueDefinition: "camelCase",
5357
+ Argument: "camelCase",
5358
+ DirectiveDefinition: "camelCase",
5359
+ EnumValueDefinition: "UPPER_CASE",
5360
+ "FieldDefinition[parent.name.value=Query]": {
5361
+ forbiddenPrefixes: ["query", "get"],
5362
+ forbiddenSuffixes: ["Query"]
5363
+ },
5364
+ "FieldDefinition[parent.name.value=Mutation]": {
5365
+ forbiddenPrefixes: ["mutation"],
5366
+ forbiddenSuffixes: ["Mutation"]
5367
+ },
5368
+ "FieldDefinition[parent.name.value=Subscription]": {
5369
+ forbiddenPrefixes: ["subscription"],
5370
+ forbiddenSuffixes: ["Subscription"]
5371
+ },
5372
+ "EnumTypeDefinition,EnumTypeExtension": {
5373
+ forbiddenPrefixes: ["Enum"],
5374
+ forbiddenSuffixes: ["Enum"]
5375
+ },
5376
+ "InterfaceTypeDefinition,InterfaceTypeExtension": {
5377
+ forbiddenPrefixes: ["Interface"],
5378
+ forbiddenSuffixes: ["Interface"]
5379
+ },
5380
+ "UnionTypeDefinition,UnionTypeExtension": {
5381
+ forbiddenPrefixes: ["Union"],
5382
+ forbiddenSuffixes: ["Union"]
5383
+ },
5384
+ "ObjectTypeDefinition,ObjectTypeExtension": {
5385
+ forbiddenPrefixes: ["Type"],
5386
+ forbiddenSuffixes: ["Type"]
5387
+ }
5388
+ }
5389
+ ],
5390
+ "@graphql-eslint/no-hashtag-description": "error",
5391
+ "@graphql-eslint/no-typename-prefix": "error",
5392
+ "@graphql-eslint/no-unreachable-types": "error",
5393
+ "@graphql-eslint/possible-type-extension": "error",
5394
+ "@graphql-eslint/provided-required-arguments": "error",
5395
+ "@graphql-eslint/require-deprecation-reason": "error",
5396
+ "@graphql-eslint/require-description": [
5397
+ "error",
5398
+ { types: !0, DirectiveDefinition: !0, rootField: !0 }
5399
+ ],
5400
+ "@graphql-eslint/strict-id-in-types": "error",
5401
+ "@graphql-eslint/unique-directive-names": "error",
5402
+ "@graphql-eslint/unique-directive-names-per-location": "error",
5403
+ "@graphql-eslint/unique-enum-value-names": "error",
5404
+ "@graphql-eslint/unique-field-definition-names": "error",
5405
+ "@graphql-eslint/unique-operation-types": "error",
5406
+ "@graphql-eslint/unique-type-names": "error"
5407
+ }
5408
+ };
5409
+
5410
+ // src/configs/schema-relay.ts
5411
+ var schema_relay_default = {
5412
+ parser: "@graphql-eslint/eslint-plugin",
5413
+ plugins: ["@graphql-eslint"],
5414
+ rules: {
5415
+ "@graphql-eslint/relay-arguments": "error",
5416
+ "@graphql-eslint/relay-connection-types": "error",
5417
+ "@graphql-eslint/relay-edge-types": "error",
5418
+ "@graphql-eslint/relay-page-info": "error"
5419
+ }
5420
+ };
5421
+
5470
5422
  // src/configs/index.ts
5471
- var import_operations_all = __toESM(require_operations_all(), 1), import_operations_recommended = __toESM(require_operations_recommended(), 1), import_schema_all = __toESM(require_schema_all(), 1), import_schema_recommended = __toESM(require_schema_recommended(), 1), import_schema_relay = __toESM(require_schema_relay(), 1), configs = {
5472
- "schema-recommended": import_schema_recommended.default,
5473
- "schema-all": import_schema_all.default,
5474
- "schema-relay": import_schema_relay.default,
5475
- "operations-recommended": import_operations_recommended.default,
5476
- "operations-all": import_operations_all.default,
5423
+ var configs = {
5424
+ "schema-recommended": schema_recommended_default,
5425
+ "schema-all": schema_all_default,
5426
+ "schema-relay": schema_relay_default,
5427
+ "operations-recommended": operations_recommended_default,
5428
+ "operations-all": operations_all_default,
5477
5429
  "flat/schema-recommended": {
5478
- rules: import_schema_recommended.default.rules
5430
+ rules: schema_recommended_default.rules
5479
5431
  },
5480
5432
  "flat/schema-all": {
5481
5433
  rules: {
5482
- ...import_schema_recommended.default.rules,
5483
- ...import_schema_all.default.rules
5434
+ ...schema_recommended_default.rules,
5435
+ ...schema_all_default.rules
5484
5436
  }
5485
5437
  },
5486
5438
  "flat/schema-relay": {
5487
- rules: import_schema_relay.default.rules
5439
+ rules: schema_relay_default.rules
5488
5440
  },
5489
5441
  "flat/operations-recommended": {
5490
- rules: import_operations_recommended.default.rules
5442
+ rules: operations_recommended_default.rules
5491
5443
  },
5492
5444
  "flat/operations-all": {
5493
5445
  rules: {
5494
- ...import_operations_recommended.default.rules,
5495
- ...import_operations_all.default.rules
5446
+ ...operations_recommended_default.rules,
5447
+ ...operations_all_default.rules
5496
5448
  }
5497
5449
  }
5498
5450
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.16",
4
4
  "type": "module",
5
5
  "description": "GraphQL plugin for ESLint",
6
6
  "repository": "https://github.com/B2o5T/graphql-eslint",
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function() {
3
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
- };
5
-
6
-
7
-
8
- exports.__commonJS = __commonJS;
@@ -1,8 +0,0 @@
1
- var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function() {
3
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
- };
5
-
6
- export {
7
- __commonJS
8
- };