@graphql-eslint/eslint-plugin 3.14.4-alpha-20221229154307-d2101f5 → 3.14.4-alpha-20221229162657-d08893a
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/configs/index.js +3 -3
- package/cjs/documents.js +2 -2
- package/cjs/flat-configs.js +1 -1
- package/cjs/graphql-config.js +1 -1
- package/cjs/index.js +3 -3
- package/cjs/parser.js +3 -3
- package/cjs/rules/match-document-filename.js +1 -1
- package/cjs/rules/no-one-place-fragments.js +1 -1
- package/cjs/rules/relay-edge-types.js +1 -1
- package/cjs/rules/relay-page-info.js +1 -1
- package/cjs/rules/require-description.js +1 -1
- package/cjs/rules/require-id-when-available.js +2 -2
- package/cjs/rules/selection-set-depth.js +1 -1
- package/cjs/schema.js +2 -2
- package/cjs/testkit.js +2 -1
- package/cjs/utils.js +1 -1
- package/docs/custom-rules.md +1 -1
- package/docs/parser-options.md +16 -0
- package/esm/configs/index.js +3 -3
- package/esm/documents.js +2 -2
- package/esm/estree-converter/converter.js +1 -1
- package/esm/estree-converter/utils.js +1 -1
- package/esm/flat-configs.js +1 -1
- package/esm/graphql-config.js +1 -1
- package/esm/index.js +1 -1
- package/esm/parser.js +3 -3
- package/esm/rules/graphql-js-validation.js +2 -2
- package/esm/rules/lone-executable-definition.js +1 -1
- package/esm/rules/match-document-filename.js +1 -1
- package/esm/rules/naming-convention.js +1 -1
- package/esm/rules/no-one-place-fragments.js +1 -1
- package/esm/rules/no-unreachable-types.js +1 -1
- package/esm/rules/relay-edge-types.js +1 -1
- package/esm/rules/relay-page-info.js +1 -1
- package/esm/rules/require-description.js +1 -1
- package/esm/rules/require-field-of-type-query-in-mutation-result.js +1 -1
- package/esm/rules/require-id-when-available.js +2 -2
- package/esm/rules/selection-set-depth.js +1 -1
- package/esm/rules/strict-id-in-types.js +1 -1
- package/esm/rules/unique-fragment-name.js +1 -1
- package/esm/schema.js +2 -2
- package/esm/testkit.js +2 -1
- package/esm/utils.js +1 -1
- package/package.json +1 -1
- package/typings/documents.d.cts +1 -1
- package/typings/documents.d.ts +1 -1
- package/typings/estree-converter/types.d.cts +2 -2
- package/typings/estree-converter/types.d.ts +2 -2
- package/typings/estree-converter/utils.d.cts +2 -2
- package/typings/estree-converter/utils.d.ts +2 -2
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
- package/typings/rules/alphabetize.d.cts +1 -1
- package/typings/rules/alphabetize.d.ts +1 -1
- package/typings/rules/description-style.d.cts +1 -1
- package/typings/rules/description-style.d.ts +1 -1
- package/typings/rules/input-name.d.cts +1 -1
- package/typings/rules/input-name.d.ts +1 -1
- package/typings/rules/lone-executable-definition.d.cts +1 -1
- package/typings/rules/lone-executable-definition.d.ts +1 -1
- package/typings/rules/match-document-filename.d.cts +2 -2
- package/typings/rules/match-document-filename.d.ts +2 -2
- package/typings/rules/naming-convention.d.cts +1 -1
- package/typings/rules/naming-convention.d.ts +1 -1
- package/typings/rules/no-root-type.d.cts +1 -1
- package/typings/rules/no-root-type.d.ts +1 -1
- package/typings/rules/relay-arguments.d.cts +1 -1
- package/typings/rules/relay-arguments.d.ts +1 -1
- package/typings/rules/relay-edge-types.d.cts +1 -1
- package/typings/rules/relay-edge-types.d.ts +1 -1
- package/typings/rules/require-deprecation-date.d.cts +1 -1
- package/typings/rules/require-deprecation-date.d.ts +1 -1
- package/typings/rules/require-id-when-available.d.cts +1 -1
- package/typings/rules/require-id-when-available.d.ts +1 -1
- package/typings/rules/selection-set-depth.d.cts +1 -1
- package/typings/rules/selection-set-depth.d.ts +1 -1
- package/typings/rules/strict-id-in-types.d.cts +1 -1
- package/typings/rules/strict-id-in-types.d.ts +1 -1
- package/typings/rules/unique-fragment-name.d.cts +1 -1
- package/typings/rules/unique-fragment-name.d.ts +1 -1
- package/typings/types.d.cts +4 -4
- package/typings/types.d.ts +4 -4
- package/typings/utils.d.cts +2 -2
- package/typings/utils.d.ts +2 -2
package/cjs/configs/index.js
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.configs = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const schema_recommended_js_1 = tslib_1.__importDefault(require("./schema-recommended.js"));
|
6
|
-
const schema_all_js_1 = tslib_1.__importDefault(require("./schema-all.js"));
|
7
|
-
const operations_recommended_js_1 = tslib_1.__importDefault(require("./operations-recommended.js"));
|
8
5
|
const operations_all_js_1 = tslib_1.__importDefault(require("./operations-all.js"));
|
6
|
+
const operations_recommended_js_1 = tslib_1.__importDefault(require("./operations-recommended.js"));
|
9
7
|
const relay_js_1 = tslib_1.__importDefault(require("./relay.js"));
|
8
|
+
const schema_all_js_1 = tslib_1.__importDefault(require("./schema-all.js"));
|
9
|
+
const schema_recommended_js_1 = tslib_1.__importDefault(require("./schema-recommended.js"));
|
10
10
|
exports.configs = {
|
11
11
|
'schema-recommended': schema_recommended_js_1.default,
|
12
12
|
'schema-all': schema_all_js_1.default,
|
package/cjs/documents.js
CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDocuments = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const path_1 = require("path");
|
6
|
-
const graphql_1 = require("graphql");
|
7
6
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
8
7
|
const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
|
9
|
-
const
|
8
|
+
const graphql_1 = require("graphql");
|
10
9
|
const cache_js_1 = require("./cache.js");
|
10
|
+
const utils_js_1 = require("./utils.js");
|
11
11
|
const debug = (0, debug_1.default)('graphql-eslint:operations');
|
12
12
|
const handleVirtualPath = (documents) => {
|
13
13
|
const filepathMap = Object.create(null);
|
package/cjs/flat-configs.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.flatConfigs = void 0;
|
4
|
-
const parser_js_1 = require("./parser.js");
|
5
4
|
const index_js_1 = require("./configs/index.js");
|
5
|
+
const parser_js_1 = require("./parser.js");
|
6
6
|
const languageOptions = {
|
7
7
|
parser: { parseForESLint: parser_js_1.parseForESLint },
|
8
8
|
};
|
package/cjs/graphql-config.js
CHANGED
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadGraphQLConfig = exports.loadOnDiskGraphQLConfig = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const path_1 = require("path");
|
6
|
+
const code_file_loader_1 = require("@graphql-tools/code-file-loader");
|
6
7
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
7
8
|
const graphql_config_1 = require("graphql-config");
|
8
|
-
const code_file_loader_1 = require("@graphql-tools/code-file-loader");
|
9
9
|
const debug = (0, debug_1.default)('graphql-eslint:graphql-config');
|
10
10
|
let graphQLConfig;
|
11
11
|
function loadOnDiskGraphQLConfig(filePath) {
|
package/cjs/index.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.flatConfigs = exports.configs = exports.processors = exports.requireSiblingsOperations = exports.requireGraphQLSchemaFromContext = exports.
|
3
|
+
exports.flatConfigs = exports.configs = exports.processors = exports.requireSiblingsOperations = exports.requireGraphQLSchemaFromContext = exports.rules = exports.parseForESLint = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const processor_js_1 = require("./processor.js");
|
6
|
-
var index_js_1 = require("./rules/index.js");
|
7
|
-
Object.defineProperty(exports, "rules", { enumerable: true, get: function () { return index_js_1.rules; } });
|
8
6
|
var parser_js_1 = require("./parser.js");
|
9
7
|
Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_js_1.parseForESLint; } });
|
8
|
+
var index_js_1 = require("./rules/index.js");
|
9
|
+
Object.defineProperty(exports, "rules", { enumerable: true, get: function () { return index_js_1.rules; } });
|
10
10
|
tslib_1.__exportStar(require("./testkit.js"), exports);
|
11
11
|
tslib_1.__exportStar(require("./types.js"), exports);
|
12
12
|
var utils_js_1 = require("./utils.js");
|
package/cjs/parser.js
CHANGED
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseForESLint = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const utils_1 = require("@graphql-tools/utils");
|
6
|
-
const graphql_1 = require("graphql");
|
7
6
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
8
|
-
const
|
9
|
-
const schema_js_1 = require("./schema.js");
|
7
|
+
const graphql_1 = require("graphql");
|
10
8
|
const documents_js_1 = require("./documents.js");
|
9
|
+
const index_js_1 = require("./estree-converter/index.js");
|
11
10
|
const graphql_config_js_1 = require("./graphql-config.js");
|
11
|
+
const schema_js_1 = require("./schema.js");
|
12
12
|
const utils_js_1 = require("./utils.js");
|
13
13
|
const debug = (0, debug_1.default)('graphql-eslint:parser');
|
14
14
|
debug('cwd %o', utils_js_1.CWD);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
|
-
const path_1 = require("path");
|
5
4
|
const fs_1 = require("fs");
|
5
|
+
const path_1 = require("path");
|
6
6
|
const graphql_1 = require("graphql");
|
7
7
|
const utils_js_1 = require("../utils.js");
|
8
8
|
const MATCH_EXTENSION = 'MATCH_EXTENSION';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
|
-
const utils_js_1 = require("../utils.js");
|
5
4
|
const path_1 = require("path");
|
6
5
|
const graphql_1 = require("graphql");
|
6
|
+
const utils_js_1 = require("../utils.js");
|
7
7
|
const RULE_ID = 'no-one-place-fragments';
|
8
8
|
exports.rule = {
|
9
9
|
meta: {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
|
-
const graphql_1 = require("graphql");
|
5
4
|
const utils_1 = require("@graphql-tools/utils");
|
5
|
+
const graphql_1 = require("graphql");
|
6
6
|
const utils_js_1 = require("../utils.js");
|
7
7
|
const RULE_ID = 'relay-edge-types';
|
8
8
|
const MESSAGE_MUST_BE_OBJECT_TYPE = 'MESSAGE_MUST_BE_OBJECT_TYPE';
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
4
|
const graphql_1 = require("graphql");
|
5
|
-
const relay_connection_types_js_1 = require("./relay-connection-types.js");
|
6
5
|
const utils_js_1 = require("../utils.js");
|
6
|
+
const relay_connection_types_js_1 = require("./relay-connection-types.js");
|
7
7
|
const RULE_ID = 'relay-page-info';
|
8
8
|
const MESSAGE_MUST_EXIST = 'MESSAGE_MUST_EXIST';
|
9
9
|
const MESSAGE_MUST_BE_OBJECT_TYPE = 'MESSAGE_MUST_BE_OBJECT_TYPE';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
|
+
const utils_1 = require("@graphql-tools/utils");
|
4
5
|
const graphql_1 = require("graphql");
|
5
6
|
const utils_js_1 = require("../utils.js");
|
6
|
-
const utils_1 = require("@graphql-tools/utils");
|
7
7
|
const RULE_ID = 'require-description';
|
8
8
|
const ALLOWED_KINDS = [
|
9
9
|
...utils_js_1.TYPES_KINDS,
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
|
-
const graphql_1 = require("graphql");
|
5
4
|
const utils_1 = require("@graphql-tools/utils");
|
6
|
-
const
|
5
|
+
const graphql_1 = require("graphql");
|
7
6
|
const index_js_1 = require("../estree-converter/index.js");
|
7
|
+
const utils_js_1 = require("../utils.js");
|
8
8
|
const RULE_ID = 'require-id-when-available';
|
9
9
|
const DEFAULT_ID_FIELD_NAME = 'id';
|
10
10
|
const schema = {
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.rule = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const graphql_depth_limit_1 = tslib_1.__importDefault(require("graphql-depth-limit"));
|
6
5
|
const graphql_1 = require("graphql");
|
6
|
+
const graphql_depth_limit_1 = tslib_1.__importDefault(require("graphql-depth-limit"));
|
7
7
|
const utils_js_1 = require("../utils.js");
|
8
8
|
const RULE_ID = 'selection-set-depth';
|
9
9
|
const schema = {
|
package/cjs/schema.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getSchema = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
6
6
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
7
7
|
const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
|
8
|
-
const
|
8
|
+
const graphql_1 = require("graphql");
|
9
9
|
const cache_js_1 = require("./cache.js");
|
10
10
|
const schemaCache = new cache_js_1.ModuleCache();
|
11
11
|
const debug = (0, debug_1.default)('graphql-eslint:schema');
|
package/cjs/testkit.js
CHANGED
@@ -4,8 +4,8 @@ exports.GraphQLRuleTester = void 0;
|
|
4
4
|
/* eslint-env vitest */
|
5
5
|
const fs_1 = require("fs");
|
6
6
|
const path_1 = require("path");
|
7
|
-
const eslint_1 = require("eslint");
|
8
7
|
const code_frame_1 = require("@babel/code-frame");
|
8
|
+
const eslint_1 = require("eslint");
|
9
9
|
function indentCode(code, indent = 4) {
|
10
10
|
return code.replace(/^/gm, ' '.repeat(indent));
|
11
11
|
}
|
@@ -154,6 +154,7 @@ function defineParser(linter, parser) {
|
|
154
154
|
const defined = parsers.get(linter);
|
155
155
|
if (!defined.has(parser)) {
|
156
156
|
defined.add(parser);
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
157
158
|
linter.defineParser(parser, require(parser));
|
158
159
|
}
|
159
160
|
}
|
package/cjs/utils.js
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.truthy = exports.englishJoinWords = exports.ARRAY_DEFAULT_OPTIONS = exports.REPORT_ON_FIRST_CHARACTER = exports.getLocation = exports.convertCase = exports.camelCase = exports.pascalCase = exports.TYPES_KINDS = exports.getTypeName = exports.CWD = exports.VIRTUAL_DOCUMENT_REGEX = exports.normalizePath = exports.logger = exports.requireGraphQLSchemaFromContext = exports.requireSiblingsOperations = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
5
6
|
const graphql_1 = require("graphql");
|
6
7
|
const lodash_lowercase_1 = tslib_1.__importDefault(require("lodash.lowercase"));
|
7
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
8
8
|
function requireSiblingsOperations(ruleId, context) {
|
9
9
|
const { siblingOperations } = context.parserServices;
|
10
10
|
if (!siblingOperations.available) {
|
package/docs/custom-rules.md
CHANGED
@@ -82,8 +82,8 @@ objects.
|
|
82
82
|
Here's an example for using original `graphql-js` validate method to validate `OperationDefinition`:
|
83
83
|
|
84
84
|
```ts
|
85
|
-
import { validate } from 'graphql'
|
86
85
|
import { requireGraphQLSchemaFromContext } from '@graphql-eslint/eslint-plugin'
|
86
|
+
import { validate } from 'graphql'
|
87
87
|
|
88
88
|
export const rule = {
|
89
89
|
create(context) {
|
package/docs/parser-options.md
CHANGED
@@ -17,9 +17,11 @@ automatically use that to load your default GraphQL schema.
|
|
17
17
|
You can disable this behaviour using `skipGraphQLConfig: true` in the `parserOptions`:
|
18
18
|
|
19
19
|
```json
|
20
|
+
{
|
20
21
|
"parserOptions": {
|
21
22
|
"skipGraphQLConfig": true
|
22
23
|
}
|
24
|
+
}
|
23
25
|
```
|
24
26
|
|
25
27
|
## `schema`
|
@@ -32,30 +34,39 @@ files.
|
|
32
34
|
Here are a few examples for a valid setup:
|
33
35
|
|
34
36
|
```json
|
37
|
+
{
|
35
38
|
"parserOptions": {
|
36
39
|
"schema": "./schema.graphql"
|
37
40
|
}
|
41
|
+
}
|
38
42
|
```
|
39
43
|
|
40
44
|
```json
|
45
|
+
{
|
41
46
|
"parserOptions": {
|
42
47
|
"schema": "./schema.json"
|
43
48
|
}
|
49
|
+
}
|
44
50
|
```
|
45
51
|
|
46
52
|
```json
|
53
|
+
{
|
47
54
|
"parserOptions": {
|
48
55
|
"schema": "http://my-server/graphql"
|
49
56
|
}
|
57
|
+
}
|
50
58
|
```
|
51
59
|
|
52
60
|
```json
|
61
|
+
{
|
53
62
|
"parserOptions": {
|
54
63
|
"schema": "./src/**/*.graphql"
|
55
64
|
}
|
65
|
+
}
|
56
66
|
```
|
57
67
|
|
58
68
|
```json
|
69
|
+
{
|
59
70
|
"parserOptions": {
|
60
71
|
"schema": [
|
61
72
|
"src/schema-a.graphql",
|
@@ -63,6 +74,7 @@ Here are a few examples for a valid setup:
|
|
63
74
|
"src/schema-c.graphql"
|
64
75
|
]
|
65
76
|
}
|
77
|
+
}
|
66
78
|
```
|
67
79
|
|
68
80
|
## `schemaOptions`
|
@@ -71,6 +83,7 @@ If you wish to send additional configuration for the `graphql-tools` loaders tha
|
|
71
83
|
you can specify `schemaOptions` object:
|
72
84
|
|
73
85
|
```json
|
86
|
+
{
|
74
87
|
"parserOptions": {
|
75
88
|
"schema": "http://my-server/graphql",
|
76
89
|
"schemaOptions": {
|
@@ -79,15 +92,18 @@ you can specify `schemaOptions` object:
|
|
79
92
|
}
|
80
93
|
}
|
81
94
|
}
|
95
|
+
}
|
82
96
|
```
|
83
97
|
|
84
98
|
```json
|
99
|
+
{
|
85
100
|
"parserOptions": {
|
86
101
|
"schema": "./src/**/*.graphql",
|
87
102
|
"schemaOptions": {
|
88
103
|
"assumeValid": true
|
89
104
|
}
|
90
105
|
}
|
106
|
+
}
|
91
107
|
```
|
92
108
|
|
93
109
|
> The configuration here is flexible, and will be sent to `graphql-tools` and it's loaders. So
|
package/esm/configs/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import schemaRecommendedConfig from './schema-recommended.js';
|
2
|
-
import schemaAllConfig from './schema-all.js';
|
3
|
-
import operationsRecommendedConfig from './operations-recommended.js';
|
4
1
|
import operationsAllConfig from './operations-all.js';
|
2
|
+
import operationsRecommendedConfig from './operations-recommended.js';
|
5
3
|
import relayConfig from './relay.js';
|
4
|
+
import schemaAllConfig from './schema-all.js';
|
5
|
+
import schemaRecommendedConfig from './schema-recommended.js';
|
6
6
|
export const configs = {
|
7
7
|
'schema-recommended': schemaRecommendedConfig,
|
8
8
|
'schema-all': schemaAllConfig,
|
package/esm/documents.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { resolve } from 'path';
|
2
|
-
import { Kind, visit, } from 'graphql';
|
3
2
|
import debugFactory from 'debug';
|
4
3
|
import fg from 'fast-glob';
|
5
|
-
import {
|
4
|
+
import { Kind, visit, } from 'graphql';
|
6
5
|
import { ModuleCache } from './cache.js';
|
6
|
+
import { logger } from './utils.js';
|
7
7
|
const debug = debugFactory('graphql-eslint:operations');
|
8
8
|
const handleVirtualPath = (documents) => {
|
9
9
|
const filepathMap = Object.create(null);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { TypeInfo, visit, visitWithTypeInfo,
|
1
|
+
import { Kind, TypeInfo, visit, visitWithTypeInfo, } from 'graphql';
|
2
2
|
import { convertLocation } from './utils.js';
|
3
3
|
export function convertToESTree(node, schema) {
|
4
4
|
const typeInfo = schema && new TypeInfo(schema);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createRequire } from 'module';
|
2
2
|
const require = createRequire(import.meta.url);
|
3
|
-
import {
|
3
|
+
import { isListType, isNonNullType, Source, TokenKind, } from 'graphql';
|
4
4
|
import { valueFromASTUntyped } from 'graphql/utilities/valueFromASTUntyped.js';
|
5
5
|
export const valueFromNode = (...args) => {
|
6
6
|
return valueFromASTUntyped(...args);
|
package/esm/flat-configs.js
CHANGED
package/esm/graphql-config.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { dirname } from 'path';
|
2
|
+
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
2
3
|
import debugFactory from 'debug';
|
3
4
|
import { GraphQLConfig, loadConfigSync, } from 'graphql-config';
|
4
|
-
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
5
5
|
const debug = debugFactory('graphql-eslint:graphql-config');
|
6
6
|
let graphQLConfig;
|
7
7
|
export function loadOnDiskGraphQLConfig(filePath) {
|
package/esm/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { processor } from './processor.js';
|
2
|
-
export { rules } from './rules/index.js';
|
3
2
|
export { parseForESLint } from './parser.js';
|
3
|
+
export { rules } from './rules/index.js';
|
4
4
|
export * from './testkit.js';
|
5
5
|
export * from './types.js';
|
6
6
|
export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.js';
|
package/esm/parser.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { parseGraphQLSDL } from '@graphql-tools/utils';
|
2
|
-
import { GraphQLError, GraphQLSchema } from 'graphql';
|
3
2
|
import debugFactory from 'debug';
|
4
|
-
import {
|
5
|
-
import { getSchema } from './schema.js';
|
3
|
+
import { GraphQLError, GraphQLSchema } from 'graphql';
|
6
4
|
import { getDocuments } from './documents.js';
|
5
|
+
import { convertToESTree, extractComments, extractTokens } from './estree-converter/index.js';
|
7
6
|
import { loadGraphQLConfig } from './graphql-config.js';
|
7
|
+
import { getSchema } from './schema.js';
|
8
8
|
import { CWD, VIRTUAL_DOCUMENT_REGEX } from './utils.js';
|
9
9
|
const debug = debugFactory('graphql-eslint:parser');
|
10
10
|
debug('cwd %o', CWD);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { createRequire } from 'module';
|
2
2
|
const require = createRequire(import.meta.url);
|
3
|
-
import { Kind,
|
3
|
+
import { Kind, validate, visit, } from 'graphql';
|
4
4
|
import { validateSDL } from 'graphql/validation/validate.js';
|
5
|
-
import {
|
5
|
+
import { ARRAY_DEFAULT_OPTIONS, logger, REPORT_ON_FIRST_CHARACTER, requireGraphQLSchemaFromContext, requireSiblingsOperations, } from '../utils.js';
|
6
6
|
function validateDocument({ context, schema = null, documentNode, rule, hasDidYouMeanSuggestions, }) {
|
7
7
|
var _a;
|
8
8
|
if (documentNode.definitions.length === 0) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ARRAY_DEFAULT_OPTIONS,
|
1
|
+
import { ARRAY_DEFAULT_OPTIONS, getLocation, pascalCase } from '../utils.js';
|
2
2
|
const RULE_ID = 'lone-executable-definition';
|
3
3
|
const definitionTypes = ['fragment', 'query', 'mutation', 'subscription'];
|
4
4
|
const schema = {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { basename, extname } from 'path';
|
2
1
|
import { existsSync } from 'fs';
|
2
|
+
import { basename, extname } from 'path';
|
3
3
|
import { Kind } from 'graphql';
|
4
4
|
import { convertCase, REPORT_ON_FIRST_CHARACTER } from '../utils.js';
|
5
5
|
const MATCH_EXTENSION = 'MATCH_EXTENSION';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Kind } from 'graphql';
|
2
|
-
import {
|
2
|
+
import { ARRAY_DEFAULT_OPTIONS, convertCase, truthy, TYPES_KINDS } from '../utils.js';
|
3
3
|
const KindToDisplayName = {
|
4
4
|
// types
|
5
5
|
[Kind.OBJECT_TYPE_DEFINITION]: 'Type',
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CWD, requireSiblingsOperations } from '../utils.js';
|
2
1
|
import { relative } from 'path';
|
3
2
|
import { visit } from 'graphql';
|
3
|
+
import { CWD, requireSiblingsOperations } from '../utils.js';
|
4
4
|
const RULE_ID = 'no-one-place-fragments';
|
5
5
|
export const rule = {
|
6
6
|
meta: {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { isInterfaceType, Kind, visit,
|
1
|
+
import { DirectiveLocation, isInterfaceType, Kind, visit, } from 'graphql';
|
2
2
|
import lowerCase from 'lodash.lowercase';
|
3
3
|
import { getTypeName, requireGraphQLSchemaFromContext } from '../utils.js';
|
4
4
|
const RULE_ID = 'no-unreachable-types';
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { visit, isObjectType, Kind, isScalarType, } from 'graphql';
|
2
1
|
import { getDocumentNodeFromSchema } from '@graphql-tools/utils';
|
2
|
+
import { isObjectType, isScalarType, Kind, visit, } from 'graphql';
|
3
3
|
import { getTypeName, requireGraphQLSchemaFromContext } from '../utils.js';
|
4
4
|
const RULE_ID = 'relay-edge-types';
|
5
5
|
const MESSAGE_MUST_BE_OBJECT_TYPE = 'MESSAGE_MUST_BE_OBJECT_TYPE';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { isScalarType, Kind } from 'graphql';
|
2
|
-
import { NON_OBJECT_TYPES } from './relay-connection-types.js';
|
3
2
|
import { REPORT_ON_FIRST_CHARACTER, requireGraphQLSchemaFromContext } from '../utils.js';
|
3
|
+
import { NON_OBJECT_TYPES } from './relay-connection-types.js';
|
4
4
|
const RULE_ID = 'relay-page-info';
|
5
5
|
const MESSAGE_MUST_EXIST = 'MESSAGE_MUST_EXIST';
|
6
6
|
const MESSAGE_MUST_BE_OBJECT_TYPE = 'MESSAGE_MUST_BE_OBJECT_TYPE';
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { getRootTypeNames } from '@graphql-tools/utils';
|
1
2
|
import { Kind, TokenKind } from 'graphql';
|
2
3
|
import { getLocation, requireGraphQLSchemaFromContext, TYPES_KINDS } from '../utils.js';
|
3
|
-
import { getRootTypeNames } from '@graphql-tools/utils';
|
4
4
|
const RULE_ID = 'require-description';
|
5
5
|
const ALLOWED_KINDS = [
|
6
6
|
...TYPES_KINDS,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { isObjectType } from 'graphql';
|
2
|
-
import {
|
2
|
+
import { getTypeName, requireGraphQLSchemaFromContext } from '../utils.js';
|
3
3
|
const RULE_ID = 'require-field-of-type-query-in-mutation-result';
|
4
4
|
export const rule = {
|
5
5
|
meta: {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { GraphQLInterfaceType, GraphQLObjectType, Kind, TypeInfo, visit, visitWithTypeInfo, } from 'graphql';
|
2
1
|
import { asArray } from '@graphql-tools/utils';
|
3
|
-
import {
|
2
|
+
import { GraphQLInterfaceType, GraphQLObjectType, Kind, TypeInfo, visit, visitWithTypeInfo, } from 'graphql';
|
4
3
|
import { getBaseType } from '../estree-converter/index.js';
|
4
|
+
import { ARRAY_DEFAULT_OPTIONS, englishJoinWords, requireGraphQLSchemaFromContext, requireSiblingsOperations, } from '../utils.js';
|
5
5
|
const RULE_ID = 'require-id-when-available';
|
6
6
|
const DEFAULT_ID_FIELD_NAME = 'id';
|
7
7
|
const schema = {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import depthLimit from 'graphql-depth-limit';
|
2
1
|
import { Kind } from 'graphql';
|
2
|
+
import depthLimit from 'graphql-depth-limit';
|
3
3
|
import { ARRAY_DEFAULT_OPTIONS, logger, requireSiblingsOperations } from '../utils.js';
|
4
4
|
const RULE_ID = 'selection-set-depth';
|
5
5
|
const schema = {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Kind } from 'graphql';
|
2
|
-
import { ARRAY_DEFAULT_OPTIONS,
|
2
|
+
import { ARRAY_DEFAULT_OPTIONS, englishJoinWords, requireGraphQLSchemaFromContext, truthy, } from '../utils.js';
|
3
3
|
const RULE_ID = 'strict-id-in-types';
|
4
4
|
const schema = {
|
5
5
|
type: 'array',
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { relative } from 'path';
|
2
2
|
import { Kind } from 'graphql';
|
3
|
-
import { normalizePath, requireSiblingsOperations, VIRTUAL_DOCUMENT_REGEX
|
3
|
+
import { CWD, normalizePath, requireSiblingsOperations, VIRTUAL_DOCUMENT_REGEX } from '../utils.js';
|
4
4
|
const RULE_ID = 'unique-fragment-name';
|
5
5
|
export const checkNode = (context, node, ruleId) => {
|
6
6
|
const documentName = node.name.value;
|
package/esm/schema.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import
|
1
|
+
import chalk from 'chalk';
|
2
2
|
import debugFactory from 'debug';
|
3
3
|
import fg from 'fast-glob';
|
4
|
-
import
|
4
|
+
import { GraphQLSchema } from 'graphql';
|
5
5
|
import { ModuleCache } from './cache.js';
|
6
6
|
const schemaCache = new ModuleCache();
|
7
7
|
const debug = debugFactory('graphql-eslint:schema');
|
package/esm/testkit.js
CHANGED
@@ -3,8 +3,8 @@ const require = createRequire(import.meta.url);
|
|
3
3
|
/* eslint-env vitest */
|
4
4
|
import { readFileSync } from 'fs';
|
5
5
|
import { resolve } from 'path';
|
6
|
-
import { RuleTester, Linter } from 'eslint';
|
7
6
|
import { codeFrameColumns } from '@babel/code-frame';
|
7
|
+
import { Linter, RuleTester } from 'eslint';
|
8
8
|
function indentCode(code, indent = 4) {
|
9
9
|
return code.replace(/^/gm, ' '.repeat(indent));
|
10
10
|
}
|
@@ -152,6 +152,7 @@ function defineParser(linter, parser) {
|
|
152
152
|
const defined = parsers.get(linter);
|
153
153
|
if (!defined.has(parser)) {
|
154
154
|
defined.add(parser);
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
155
156
|
linter.defineParser(parser, require(parser));
|
156
157
|
}
|
157
158
|
}
|
package/esm/utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
import chalk from 'chalk';
|
1
2
|
import { Kind } from 'graphql';
|
2
3
|
import lowerCase from 'lodash.lowercase';
|
3
|
-
import chalk from 'chalk';
|
4
4
|
export function requireSiblingsOperations(ruleId, context) {
|
5
5
|
const { siblingOperations } = context.parserServices;
|
6
6
|
if (!siblingOperations.available) {
|
package/package.json
CHANGED
package/typings/documents.d.cts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FragmentDefinitionNode, OperationDefinitionNode,
|
1
|
+
import { FragmentDefinitionNode, OperationDefinitionNode, OperationTypeNode, SelectionSetNode } from 'graphql';
|
2
2
|
import { GraphQLProjectConfig } from 'graphql-config';
|
3
3
|
export type FragmentSource = {
|
4
4
|
filePath: string;
|
package/typings/documents.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FragmentDefinitionNode, OperationDefinitionNode,
|
1
|
+
import { FragmentDefinitionNode, OperationDefinitionNode, OperationTypeNode, SelectionSetNode } from 'graphql';
|
2
2
|
import { GraphQLProjectConfig } from 'graphql-config';
|
3
3
|
export type FragmentSource = {
|
4
4
|
filePath: string;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode, DirectiveNode } from 'graphql';
|
2
|
-
import { SourceLocation, Comment } from 'estree';
|
3
1
|
import { AST } from 'eslint';
|
2
|
+
import { Comment, SourceLocation } from 'estree';
|
3
|
+
import { ArgumentNode, ASTNode, DefinitionNode, DirectiveDefinitionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, ExecutableDefinitionNode, FieldDefinitionNode, FieldNode, FragmentSpreadNode, InlineFragmentNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ListTypeNode, NamedTypeNode, NameNode, NonNullTypeNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeDefinitionNode, SelectionNode, SelectionSetNode, TypeDefinitionNode, TypeExtensionNode, TypeInfo, TypeNode, VariableDefinitionNode, VariableNode } from 'graphql';
|
4
4
|
type SafeGraphQLType<T extends ASTNode> = T extends {
|
5
5
|
type: TypeNode;
|
6
6
|
} ? Omit<T, 'loc' | 'type'> & {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ASTNode, TypeInfo, TypeNode, DocumentNode, ExecutableDefinitionNode, NameNode, TypeDefinitionNode, FieldDefinitionNode, ObjectTypeExtensionNode, ObjectTypeDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, SelectionSetNode, SelectionNode, DefinitionNode, TypeExtensionNode, DirectiveDefinitionNode, VariableNode, FieldNode, FragmentSpreadNode, EnumValueDefinitionNode, ArgumentNode, NamedTypeNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, InputValueDefinitionNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InlineFragmentNode, VariableDefinitionNode, ListTypeNode, NonNullTypeNode, OperationTypeDefinitionNode, DirectiveNode } from 'graphql';
|
2
|
-
import { SourceLocation, Comment } from 'estree';
|
3
1
|
import { AST } from 'eslint';
|
2
|
+
import { Comment, SourceLocation } from 'estree';
|
3
|
+
import { ArgumentNode, ASTNode, DefinitionNode, DirectiveDefinitionNode, DirectiveNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, EnumValueDefinitionNode, ExecutableDefinitionNode, FieldDefinitionNode, FieldNode, FragmentSpreadNode, InlineFragmentNode, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ListTypeNode, NamedTypeNode, NameNode, NonNullTypeNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeDefinitionNode, SelectionNode, SelectionSetNode, TypeDefinitionNode, TypeExtensionNode, TypeInfo, TypeNode, VariableDefinitionNode, VariableNode } from 'graphql';
|
4
4
|
type SafeGraphQLType<T extends ASTNode> = T extends {
|
5
5
|
type: TypeNode;
|
6
6
|
} ? Omit<T, 'loc' | 'type'> & {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Location, GraphQLOutputType, GraphQLNamedType, Token } from 'graphql';
|
2
|
-
import { Comment, SourceLocation } from 'estree';
|
3
1
|
import { AST } from 'eslint';
|
2
|
+
import { Comment, SourceLocation } from 'estree';
|
3
|
+
import { GraphQLNamedType, GraphQLOutputType, Location, Token } from 'graphql';
|
4
4
|
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/Maybe").Maybe<import("graphql/jsutils/ObjMap").ObjMap<unknown>>) => any;
|
5
5
|
export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
|
6
6
|
type TokenKindValue = '<SOF>' | '!' | '$' | '&' | '(' | ')' | '...' | ':' | '=' | '@' | '[' | ']' | '{' | '|' | '}' | 'Name' | 'Int' | 'Float' | 'String' | 'BlockString' | 'Comment';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Location, GraphQLOutputType, GraphQLNamedType, Token } from 'graphql';
|
2
|
-
import { Comment, SourceLocation } from 'estree';
|
3
1
|
import { AST } from 'eslint';
|
2
|
+
import { Comment, SourceLocation } from 'estree';
|
3
|
+
import { GraphQLNamedType, GraphQLOutputType, Location, Token } from 'graphql';
|
4
4
|
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/Maybe").Maybe<import("graphql/jsutils/ObjMap").ObjMap<unknown>>) => any;
|
5
5
|
export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
|
6
6
|
type TokenKindValue = '<SOF>' | '!' | '$' | '&' | '(' | ')' | '...' | ':' | '=' | '@' | '[' | ']' | '{' | '|' | '}' | 'Name' | 'Int' | 'Float' | 'String' | 'BlockString' | 'Comment';
|
package/typings/index.d.cts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { rules } from './rules/index.cjs';
|
2
1
|
export { parseForESLint } from './parser.cjs';
|
2
|
+
export { rules } from './rules/index.cjs';
|
3
3
|
export * from './testkit.cjs';
|
4
4
|
export * from './types.cjs';
|
5
5
|
export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.cjs';
|
package/typings/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { rules } from './rules/index.js';
|
2
1
|
export { parseForESLint } from './parser.js';
|
2
|
+
export { rules } from './rules/index.js';
|
3
3
|
export * from './testkit.js';
|
4
4
|
export * from './types.js';
|
5
5
|
export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.js';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CaseStyle as _CaseStyle } from '../utils.cjs';
|
2
|
-
import { GraphQLESLintRule } from '../types.cjs';
|
3
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
|
+
import { GraphQLESLintRule } from '../types.cjs';
|
3
|
+
import { CaseStyle as _CaseStyle } from '../utils.cjs';
|
4
4
|
type CaseStyle = _CaseStyle | 'matchDocumentStyle';
|
5
5
|
declare const schema: {
|
6
6
|
readonly definitions: {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CaseStyle as _CaseStyle } from '../utils.js';
|
2
|
-
import { GraphQLESLintRule } from '../types.js';
|
3
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
|
+
import { GraphQLESLintRule } from '../types.js';
|
3
|
+
import { CaseStyle as _CaseStyle } from '../utils.js';
|
4
4
|
type CaseStyle = _CaseStyle | 'matchDocumentStyle';
|
5
5
|
declare const schema: {
|
6
6
|
readonly definitions: {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { GraphQLESLintRule } from '../types.cjs';
|
2
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
|
+
import { GraphQLESLintRule } from '../types.cjs';
|
3
3
|
type AllowedStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE';
|
4
4
|
declare const schema: {
|
5
5
|
readonly definitions: {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { GraphQLESLintRule } from '../types.js';
|
2
1
|
import { FromSchema } from 'json-schema-to-ts';
|
2
|
+
import { GraphQLESLintRule } from '../types.js';
|
3
3
|
type AllowedStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE';
|
4
4
|
declare const schema: {
|
5
5
|
readonly definitions: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ExecutableDefinitionNode } from 'graphql';
|
2
|
-
import { GraphQLESLintRule, GraphQLESLintRuleContext } from '../types.cjs';
|
3
2
|
import { GraphQLESTreeNode } from '../estree-converter/index.cjs';
|
3
|
+
import { GraphQLESLintRule, GraphQLESLintRuleContext } from '../types.cjs';
|
4
4
|
export declare const checkNode: (context: GraphQLESLintRuleContext, node: GraphQLESTreeNode<ExecutableDefinitionNode>, ruleId: string) => void;
|
5
5
|
export declare const rule: GraphQLESLintRule;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ExecutableDefinitionNode } from 'graphql';
|
2
|
-
import { GraphQLESLintRule, GraphQLESLintRuleContext } from '../types.js';
|
3
2
|
import { GraphQLESTreeNode } from '../estree-converter/index.js';
|
3
|
+
import { GraphQLESLintRule, GraphQLESLintRuleContext } from '../types.js';
|
4
4
|
export declare const checkNode: (context: GraphQLESLintRuleContext, node: GraphQLESTreeNode<ExecutableDefinitionNode>, ruleId: string) => void;
|
5
5
|
export declare const rule: GraphQLESLintRule;
|
package/typings/types.d.cts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { GraphQLParseOptions } from '@graphql-tools/utils';
|
2
|
+
import { AST, Linter, Rule } from 'eslint';
|
2
3
|
import * as ESTree from 'estree';
|
3
4
|
import { GraphQLSchema } from 'graphql';
|
4
5
|
import { IExtensions, IGraphQLProject } from 'graphql-config';
|
5
|
-
import { GraphQLParseOptions } from '@graphql-tools/utils';
|
6
|
-
import { GraphQLESLintRuleListener } from './testkit.cjs';
|
7
|
-
import { SiblingOperations } from './documents.cjs';
|
8
6
|
import { JSONSchema } from 'json-schema-to-ts';
|
7
|
+
import { SiblingOperations } from './documents.cjs';
|
8
|
+
import { GraphQLESLintRuleListener } from './testkit.cjs';
|
9
9
|
export type Schema = GraphQLSchema | Error | null;
|
10
10
|
export type Pointer = string | string[];
|
11
11
|
export interface ParserOptions {
|
package/typings/types.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { GraphQLParseOptions } from '@graphql-tools/utils';
|
2
|
+
import { AST, Linter, Rule } from 'eslint';
|
2
3
|
import * as ESTree from 'estree';
|
3
4
|
import { GraphQLSchema } from 'graphql';
|
4
5
|
import { IExtensions, IGraphQLProject } from 'graphql-config';
|
5
|
-
import { GraphQLParseOptions } from '@graphql-tools/utils';
|
6
|
-
import { GraphQLESLintRuleListener } from './testkit.js';
|
7
|
-
import { SiblingOperations } from './documents.js';
|
8
6
|
import { JSONSchema } from 'json-schema-to-ts';
|
7
|
+
import { SiblingOperations } from './documents.js';
|
8
|
+
import { GraphQLESLintRuleListener } from './testkit.js';
|
9
9
|
export type Schema = GraphQLSchema | Error | null;
|
10
10
|
export type Pointer = string | string[];
|
11
11
|
export interface ParserOptions {
|
package/typings/utils.d.cts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
|
2
1
|
import { AST } from 'eslint';
|
3
2
|
import { Position } from 'estree';
|
4
|
-
import {
|
3
|
+
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
|
5
4
|
import { SiblingOperations } from './documents.cjs';
|
5
|
+
import { GraphQLESLintRuleContext } from './types.cjs';
|
6
6
|
export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
|
7
7
|
export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
|
8
8
|
export declare const logger: {
|
package/typings/utils.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
|
2
1
|
import { AST } from 'eslint';
|
3
2
|
import { Position } from 'estree';
|
4
|
-
import {
|
3
|
+
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
|
5
4
|
import { SiblingOperations } from './documents.js';
|
5
|
+
import { GraphQLESLintRuleContext } from './types.js';
|
6
6
|
export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
|
7
7
|
export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
|
8
8
|
export declare const logger: {
|