@graphql-eslint/eslint-plugin 3.20.0-alpha-20230704093543-0a20572 → 3.20.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/graphql-config.js +1 -1
- package/cjs/rules/match-document-filename.js +1 -1
- package/cjs/rules/no-unreachable-types.js +1 -1
- package/cjs/rules/no-unused-fields.js +1 -1
- package/cjs/rules/relay-edge-types.js +1 -1
- package/cjs/rules/relay-page-info.js +1 -1
- package/esm/graphql-config.js +1 -1
- package/esm/rules/match-document-filename.js +1 -1
- package/esm/rules/no-unreachable-types.js +1 -1
- package/esm/rules/no-unused-fields.js +1 -1
- package/esm/rules/relay-edge-types.js +1 -1
- package/esm/rules/relay-page-info.js +1 -1
- package/package.json +1 -1
package/cjs/graphql-config.js
CHANGED
@@ -48,7 +48,7 @@ function loadOnDiskGraphQLConfig(filePath) {
|
|
48
48
|
});
|
49
49
|
}
|
50
50
|
function loadGraphQLConfig(options) {
|
51
|
-
if (
|
51
|
+
if (graphQLConfig) {
|
52
52
|
return graphQLConfig;
|
53
53
|
}
|
54
54
|
const onDiskConfig = !options.skipGraphQLConfig && loadOnDiskGraphQLConfig(options.filePath);
|
@@ -213,7 +213,7 @@ const rule = {
|
|
213
213
|
};
|
214
214
|
const filePath = context.getFilename();
|
215
215
|
const isVirtualFile = import_utils.VIRTUAL_DOCUMENT_REGEX.test(filePath);
|
216
|
-
if (
|
216
|
+
if (isVirtualFile) {
|
217
217
|
return {};
|
218
218
|
}
|
219
219
|
const fileExtension = (0, import_path.extname)(filePath);
|
@@ -62,7 +62,7 @@ const RequestDirectiveLocations = /* @__PURE__ */ new Set([
|
|
62
62
|
import_graphql.DirectiveLocation.VARIABLE_DEFINITION
|
63
63
|
]);
|
64
64
|
function getReachableTypes(schema) {
|
65
|
-
if (
|
65
|
+
if (reachableTypesCache) {
|
66
66
|
return reachableTypesCache;
|
67
67
|
}
|
68
68
|
const reachableTypes = /* @__PURE__ */ new Set();
|
@@ -26,7 +26,7 @@ var import_utils = require("../utils.js");
|
|
26
26
|
const RULE_ID = "no-unused-fields";
|
27
27
|
let usedFieldsCache;
|
28
28
|
function getUsedFields(schema, operations) {
|
29
|
-
if (
|
29
|
+
if (usedFieldsCache) {
|
30
30
|
return usedFieldsCache;
|
31
31
|
}
|
32
32
|
const usedFields = /* @__PURE__ */ Object.create(null);
|
@@ -31,7 +31,7 @@ const MESSAGE_LIST_TYPE_ONLY_EDGE_TYPE = "MESSAGE_LIST_TYPE_ONLY_EDGE_TYPE";
|
|
31
31
|
const MESSAGE_SHOULD_IMPLEMENTS_NODE = "MESSAGE_SHOULD_IMPLEMENTS_NODE";
|
32
32
|
let edgeTypesCache;
|
33
33
|
function getEdgeTypes(schema2) {
|
34
|
-
if (
|
34
|
+
if (edgeTypesCache) {
|
35
35
|
return edgeTypesCache;
|
36
36
|
}
|
37
37
|
const edgeTypes = /* @__PURE__ */ new Set();
|
@@ -69,7 +69,7 @@ const rule = {
|
|
69
69
|
},
|
70
70
|
create(context) {
|
71
71
|
const schema = (0, import_utils.requireGraphQLSchemaFromContext)(RULE_ID, context);
|
72
|
-
if (
|
72
|
+
if (!hasPageInfoChecked) {
|
73
73
|
const pageInfoType = schema.getType("PageInfo");
|
74
74
|
if (!pageInfoType) {
|
75
75
|
context.report({
|
package/esm/graphql-config.js
CHANGED
@@ -17,7 +17,7 @@ function loadOnDiskGraphQLConfig(filePath) {
|
|
17
17
|
});
|
18
18
|
}
|
19
19
|
function loadGraphQLConfig(options) {
|
20
|
-
if (
|
20
|
+
if (graphQLConfig) {
|
21
21
|
return graphQLConfig;
|
22
22
|
}
|
23
23
|
const onDiskConfig = !options.skipGraphQLConfig && loadOnDiskGraphQLConfig(options.filePath);
|
@@ -194,7 +194,7 @@ const rule = {
|
|
194
194
|
};
|
195
195
|
const filePath = context.getFilename();
|
196
196
|
const isVirtualFile = VIRTUAL_DOCUMENT_REGEX.test(filePath);
|
197
|
-
if (
|
197
|
+
if (isVirtualFile) {
|
198
198
|
return {};
|
199
199
|
}
|
200
200
|
const fileExtension = extname(filePath);
|
@@ -34,7 +34,7 @@ const RequestDirectiveLocations = /* @__PURE__ */ new Set([
|
|
34
34
|
DirectiveLocation.VARIABLE_DEFINITION
|
35
35
|
]);
|
36
36
|
function getReachableTypes(schema) {
|
37
|
-
if (
|
37
|
+
if (reachableTypesCache) {
|
38
38
|
return reachableTypesCache;
|
39
39
|
}
|
40
40
|
const reachableTypes = /* @__PURE__ */ new Set();
|
@@ -3,7 +3,7 @@ import { requireGraphQLSchemaFromContext, requireSiblingsOperations } from "../u
|
|
3
3
|
const RULE_ID = "no-unused-fields";
|
4
4
|
let usedFieldsCache;
|
5
5
|
function getUsedFields(schema, operations) {
|
6
|
-
if (
|
6
|
+
if (usedFieldsCache) {
|
7
7
|
return usedFieldsCache;
|
8
8
|
}
|
9
9
|
const usedFields = /* @__PURE__ */ Object.create(null);
|
@@ -13,7 +13,7 @@ const MESSAGE_LIST_TYPE_ONLY_EDGE_TYPE = "MESSAGE_LIST_TYPE_ONLY_EDGE_TYPE";
|
|
13
13
|
const MESSAGE_SHOULD_IMPLEMENTS_NODE = "MESSAGE_SHOULD_IMPLEMENTS_NODE";
|
14
14
|
let edgeTypesCache;
|
15
15
|
function getEdgeTypes(schema2) {
|
16
|
-
if (
|
16
|
+
if (edgeTypesCache) {
|
17
17
|
return edgeTypesCache;
|
18
18
|
}
|
19
19
|
const edgeTypes = /* @__PURE__ */ new Set();
|
@@ -46,7 +46,7 @@ const rule = {
|
|
46
46
|
},
|
47
47
|
create(context) {
|
48
48
|
const schema = requireGraphQLSchemaFromContext(RULE_ID, context);
|
49
|
-
if (
|
49
|
+
if (!hasPageInfoChecked) {
|
50
50
|
const pageInfoType = schema.getType("PageInfo");
|
51
51
|
if (!pageInfoType) {
|
52
52
|
context.report({
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-eslint/eslint-plugin",
|
3
|
-
"version": "3.20.0
|
3
|
+
"version": "3.20.0",
|
4
4
|
"description": "GraphQL plugin for ESLint",
|
5
5
|
"repository": "https://github.com/B2o5T/graphql-eslint",
|
6
6
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|