@graphql-eslint/eslint-plugin 3.20.0-alpha-20230704093215-acb5f28 → 3.20.0-alpha-20230704095135-8d287d5
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/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 +6 -6
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-alpha-
|
3
|
+
"version": "3.20.0-alpha-20230704095135-8d287d5",
|
4
4
|
"description": "GraphQL plugin for ESLint",
|
5
5
|
"repository": "https://github.com/B2o5T/graphql-eslint",
|
6
6
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
@@ -14,20 +14,20 @@
|
|
14
14
|
"./package.json": "./package.json",
|
15
15
|
".": {
|
16
16
|
"require": {
|
17
|
-
"types": "./
|
17
|
+
"types": "./cjs/index.d.ts",
|
18
18
|
"default": "./cjs/index.js"
|
19
19
|
},
|
20
20
|
"import": {
|
21
|
-
"types": "./
|
21
|
+
"types": "./esm/index.d.mts",
|
22
22
|
"default": "./esm/index.js"
|
23
23
|
},
|
24
24
|
"default": {
|
25
|
-
"types": "./
|
25
|
+
"types": "./esm/index.d.mts",
|
26
26
|
"default": "./esm/index.js"
|
27
27
|
}
|
28
28
|
}
|
29
29
|
},
|
30
|
-
"typings": "
|
30
|
+
"typings": "esm/index.d.mts",
|
31
31
|
"keywords": [
|
32
32
|
"eslint",
|
33
33
|
"eslintplugin",
|
@@ -56,7 +56,7 @@
|
|
56
56
|
},
|
57
57
|
"sideEffects": false,
|
58
58
|
"typescript": {
|
59
|
-
"definition": "
|
59
|
+
"definition": "cjs/index.d.ts"
|
60
60
|
},
|
61
61
|
"scripts": {
|
62
62
|
"build": "tsup"
|