@graphql-eslint/eslint-plugin 4.0.0-alpha.2 → 4.0.0-alpha.3

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.
@@ -4,6 +4,11 @@ declare const configs: {
4
4
  'schema-relay': any;
5
5
  'operations-recommended': any;
6
6
  'operations-all': any;
7
+ 'flat/schema-recommended': any;
8
+ 'flat/schema-all': any;
9
+ 'flat/schema-relay': any;
10
+ 'flat/operations-recommended': any;
11
+ 'flat/operations-all': any;
7
12
  };
8
13
 
9
14
  export { configs };
@@ -32,7 +32,18 @@ const configs = {
32
32
  "schema-all": import_schema_all.default,
33
33
  "schema-relay": import_schema_relay.default,
34
34
  "operations-recommended": import_operations_recommended.default,
35
- "operations-all": import_operations_all.default
35
+ "operations-all": import_operations_all.default,
36
+ "flat/schema-recommended": import_schema_recommended.default.rules,
37
+ "flat/schema-all": {
38
+ ...import_schema_recommended.default.rules,
39
+ ...import_schema_all.default.rules
40
+ },
41
+ "flat/schema-relay": import_schema_relay.default.rules,
42
+ "flat/operations-recommended": import_operations_recommended.default.rules,
43
+ "flat/operations-all": {
44
+ ...import_operations_recommended.default.rules,
45
+ ...import_operations_all.default.rules
46
+ }
36
47
  };
37
48
  // Annotate the CommonJS export names for ESM import in node:
38
49
  0 && (module.exports = {
package/cjs/index.d.cts CHANGED
@@ -5,7 +5,6 @@ export { rules } from './rules/index.cjs';
5
5
  export { CategoryType, ConfigName, GraphQLESLintParseResult, GraphQLESLintRule, GraphQLESLintRuleContext, GraphQLESLintRuleListener, OmitRecursively, ParserOptions, ParserServices, Pointer, ReportDescriptor, RuleDocsInfo, Schema, ValueOf } from './types.cjs';
6
6
  export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.cjs';
7
7
  export { configs } from './configs/index.cjs';
8
- export { flatConfigs } from './flat-configs.cjs';
9
8
  export { GraphQLESTreeNode } from './estree-converter/types.cjs';
10
9
  import './rules/require-description.cjs';
11
10
  import 'graphql';
package/cjs/index.js CHANGED
@@ -16,7 +16,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0
16
16
  var src_exports = {};
17
17
  __export(src_exports, {
18
18
  configs: () => import_configs.configs,
19
- flatConfigs: () => import_flat_configs.flatConfigs,
20
19
  parseForESLint: () => import_parser.parseForESLint,
21
20
  parser: () => import_parser.parser,
22
21
  processors: () => processors,
@@ -27,12 +26,11 @@ __export(src_exports, {
27
26
  module.exports = __toCommonJS(src_exports);
28
27
  var import_processor = require("./processor.js"), import_parser = require("./parser.js"), import_rules = require("./rules/index.js");
29
28
  __reExport(src_exports, require("./types.js"), module.exports);
30
- var import_utils = require("./utils.js"), import_configs = require("./configs/index.js"), import_flat_configs = require("./flat-configs.js");
29
+ var import_utils = require("./utils.js"), import_configs = require("./configs/index.js");
31
30
  const processors = { graphql: import_processor.processor };
32
31
  // Annotate the CommonJS export names for ESM import in node:
33
32
  0 && (module.exports = {
34
33
  configs,
35
- flatConfigs,
36
34
  parseForESLint,
37
35
  parser,
38
36
  processors,
@@ -38,22 +38,22 @@ declare const rules: {
38
38
  suffix?: string | undefined;
39
39
  prefix?: string | undefined;
40
40
  } | undefined;
41
- mutation?: (CaseStyle | "matchDocumentStyle") | {
41
+ fileExtension?: ".gql" | ".graphql" | undefined;
42
+ query?: (CaseStyle | "matchDocumentStyle") | {
42
43
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
43
44
  suffix?: string | undefined;
44
45
  prefix?: string | undefined;
45
46
  } | undefined;
46
- subscription?: (CaseStyle | "matchDocumentStyle") | {
47
+ mutation?: (CaseStyle | "matchDocumentStyle") | {
47
48
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
48
49
  suffix?: string | undefined;
49
50
  prefix?: string | undefined;
50
51
  } | undefined;
51
- query?: (CaseStyle | "matchDocumentStyle") | {
52
+ subscription?: (CaseStyle | "matchDocumentStyle") | {
52
53
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
53
54
  suffix?: string | undefined;
54
55
  prefix?: string | undefined;
55
56
  } | undefined;
56
- fileExtension?: ".gql" | ".graphql" | undefined;
57
57
  }[]>;
58
58
  'naming-convention': GraphQLESLintRule<{
59
59
  [x: string]: unknown;
@@ -4,6 +4,11 @@ declare const configs: {
4
4
  'schema-relay': any;
5
5
  'operations-recommended': any;
6
6
  'operations-all': any;
7
+ 'flat/schema-recommended': any;
8
+ 'flat/schema-all': any;
9
+ 'flat/schema-relay': any;
10
+ 'flat/operations-recommended': any;
11
+ 'flat/operations-all': any;
7
12
  };
8
13
 
9
14
  export { configs };
@@ -9,7 +9,18 @@ const configs = {
9
9
  "schema-all": schemaAllConfig,
10
10
  "schema-relay": relayConfig,
11
11
  "operations-recommended": operationsRecommendedConfig,
12
- "operations-all": operationsAllConfig
12
+ "operations-all": operationsAllConfig,
13
+ "flat/schema-recommended": schemaRecommendedConfig.rules,
14
+ "flat/schema-all": {
15
+ ...schemaRecommendedConfig.rules,
16
+ ...schemaAllConfig.rules
17
+ },
18
+ "flat/schema-relay": relayConfig.rules,
19
+ "flat/operations-recommended": operationsRecommendedConfig.rules,
20
+ "flat/operations-all": {
21
+ ...operationsRecommendedConfig.rules,
22
+ ...operationsAllConfig.rules
23
+ }
13
24
  };
14
25
  export {
15
26
  configs
package/esm/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export { rules } from './rules/index.js';
5
5
  export { CategoryType, ConfigName, GraphQLESLintParseResult, GraphQLESLintRule, GraphQLESLintRuleContext, GraphQLESLintRuleListener, OmitRecursively, ParserOptions, ParserServices, Pointer, ReportDescriptor, RuleDocsInfo, Schema, ValueOf } from './types.js';
6
6
  export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils.js';
7
7
  export { configs } from './configs/index.js';
8
- export { flatConfigs } from './flat-configs.js';
9
8
  export { GraphQLESTreeNode } from './estree-converter/types.js';
10
9
  import './rules/require-description.js';
11
10
  import 'graphql';
package/esm/index.js CHANGED
@@ -6,10 +6,8 @@ export * from "./types.js";
6
6
  import { requireGraphQLSchemaFromContext, requireSiblingsOperations } from "./utils.js";
7
7
  const processors = { graphql: processor };
8
8
  import { configs } from "./configs/index.js";
9
- import { flatConfigs } from "./flat-configs.js";
10
9
  export {
11
10
  configs,
12
- flatConfigs,
13
11
  parseForESLint,
14
12
  parser,
15
13
  processors,
@@ -38,22 +38,22 @@ declare const rules: {
38
38
  suffix?: string | undefined;
39
39
  prefix?: string | undefined;
40
40
  } | undefined;
41
- mutation?: (CaseStyle | "matchDocumentStyle") | {
41
+ fileExtension?: ".gql" | ".graphql" | undefined;
42
+ query?: (CaseStyle | "matchDocumentStyle") | {
42
43
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
43
44
  suffix?: string | undefined;
44
45
  prefix?: string | undefined;
45
46
  } | undefined;
46
- subscription?: (CaseStyle | "matchDocumentStyle") | {
47
+ mutation?: (CaseStyle | "matchDocumentStyle") | {
47
48
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
48
49
  suffix?: string | undefined;
49
50
  prefix?: string | undefined;
50
51
  } | undefined;
51
- query?: (CaseStyle | "matchDocumentStyle") | {
52
+ subscription?: (CaseStyle | "matchDocumentStyle") | {
52
53
  style?: (CaseStyle | "matchDocumentStyle") | undefined;
53
54
  suffix?: string | undefined;
54
55
  prefix?: string | undefined;
55
56
  } | undefined;
56
- fileExtension?: ".gql" | ".graphql" | undefined;
57
57
  }[]>;
58
58
  'naming-convention': GraphQLESLintRule<{
59
59
  [x: string]: unknown;
package/index.browser.js CHANGED
@@ -246,20 +246,11 @@ import debugFactory from "debug";
246
246
  var log = debugFactory("graphql-eslint:ModuleCache"), ModuleCache = class {
247
247
  map = /* @__PURE__ */ new Map();
248
248
  set(cacheKey, result) {
249
- this.map.set(cacheKey, { lastSeen: process.hrtime(), result }), log("setting entry for", cacheKey);
250
249
  }
251
250
  get(cacheKey, settings = {
252
251
  lifetime: 10
253
252
  /* seconds */
254
253
  }) {
255
- let value = this.map.get(cacheKey);
256
- if (!value) {
257
- log("cache miss for", cacheKey);
258
- return;
259
- }
260
- let { lastSeen, result } = value;
261
- if (process.env.NODE || process.hrtime(lastSeen)[0] < settings.lifetime)
262
- return result;
263
254
  }
264
255
  };
265
256
 
@@ -399,7 +390,7 @@ function convertToESTree(node, schema15) {
399
390
  // package.json
400
391
  var package_default = {
401
392
  name: "@graphql-eslint/eslint-plugin",
402
- version: "4.0.0-alpha.2",
393
+ version: "4.0.0-alpha.3",
403
394
  type: "module",
404
395
  description: "GraphQL plugin for ESLint",
405
396
  repository: "https://github.com/B2o5T/graphql-eslint",
@@ -444,11 +435,11 @@ var package_default = {
444
435
  },
445
436
  dependencies: {
446
437
  "@graphql-tools/code-file-loader": "^8.0.0",
447
- "@graphql-tools/graphql-tag-pluck": "^8.0.0",
438
+ "@graphql-tools/graphql-tag-pluck": "8.3.2-alpha-20240803110708-298aeb8bb2ca4ef649bf09fc42f82fc88c6d5e13",
448
439
  "@graphql-tools/utils": "^10.0.0",
449
440
  debug: "^4.3.4",
450
441
  "fast-glob": "^3.2.12",
451
- "graphql-config": "^5.0.0",
442
+ "graphql-config": "^5.1.0",
452
443
  "graphql-depth-limit": "^1.1.0",
453
444
  "lodash.lowercase": "^4.3.0"
454
445
  },
@@ -5384,40 +5375,21 @@ var import_operations_all = __toESM(require_operations_all(), 1), import_operati
5384
5375
  "schema-all": import_schema_all.default,
5385
5376
  "schema-relay": import_schema_relay.default,
5386
5377
  "operations-recommended": import_operations_recommended.default,
5387
- "operations-all": import_operations_all.default
5388
- };
5389
-
5390
- // src/flat-configs.ts
5391
- var languageOptions = { parser }, flatConfigs = {
5392
- "operations-all": {
5393
- languageOptions,
5394
- rules: {
5395
- ...configs["operations-recommended"].rules,
5396
- ...configs["operations-all"].rules
5397
- }
5398
- },
5399
- "operations-recommended": {
5400
- languageOptions,
5401
- rules: configs["operations-recommended"].rules
5402
- },
5403
- "schema-relay": {
5404
- languageOptions,
5405
- rules: configs["schema-relay"].rules
5406
- },
5407
- "schema-all": {
5408
- languageOptions,
5409
- rules: {
5410
- ...configs["schema-recommended"].rules,
5411
- ...configs["schema-all"].rules
5412
- }
5378
+ "operations-all": import_operations_all.default,
5379
+ "flat/schema-recommended": import_schema_recommended.default.rules,
5380
+ "flat/schema-all": {
5381
+ ...import_schema_recommended.default.rules,
5382
+ ...import_schema_all.default.rules
5413
5383
  },
5414
- "schema-recommended": {
5415
- languageOptions,
5416
- rules: configs["schema-recommended"].rules
5384
+ "flat/schema-relay": import_schema_relay.default.rules,
5385
+ "flat/operations-recommended": import_operations_recommended.default.rules,
5386
+ "flat/operations-all": {
5387
+ ...import_operations_recommended.default.rules,
5388
+ ...import_operations_all.default.rules
5417
5389
  }
5418
5390
  };
5419
5391
  export {
5420
- flatConfigs,
5392
+ configs,
5421
5393
  parser,
5422
5394
  rules
5423
5395
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "type": "module",
5
5
  "description": "GraphQL plugin for ESLint",
6
6
  "repository": "https://github.com/B2o5T/graphql-eslint",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@graphql-tools/code-file-loader": "^8.0.0",
43
- "@graphql-tools/graphql-tag-pluck": "^8.0.0",
43
+ "@graphql-tools/graphql-tag-pluck": "8.3.2-alpha-20240803110708-298aeb8bb2ca4ef649bf09fc42f82fc88c6d5e13",
44
44
  "@graphql-tools/utils": "^10.0.0",
45
45
  "debug": "^4.3.4",
46
46
  "fast-glob": "^3.2.12",
47
- "graphql-config": "^5.0.0",
47
+ "graphql-config": "^5.1.0",
48
48
  "graphql-depth-limit": "^1.1.0",
49
49
  "lodash.lowercase": "^4.3.0"
50
50
  },
@@ -1,75 +0,0 @@
1
- import { parseForESLint } from './parser.cjs';
2
- import './types.cjs';
3
- import 'eslint';
4
- import 'estree';
5
- import 'graphql';
6
- import 'graphql-config';
7
- import 'json-schema-to-ts';
8
- import './estree-converter/types.cjs';
9
- import './siblings.cjs';
10
- import '@graphql-tools/utils';
11
-
12
- declare const flatConfigs: {
13
- 'operations-all': {
14
- languageOptions: {
15
- parser: {
16
- parseForESLint: typeof parseForESLint;
17
- meta: {
18
- name: string;
19
- version: string;
20
- };
21
- };
22
- };
23
- rules: any;
24
- };
25
- 'operations-recommended': {
26
- languageOptions: {
27
- parser: {
28
- parseForESLint: typeof parseForESLint;
29
- meta: {
30
- name: string;
31
- version: string;
32
- };
33
- };
34
- };
35
- rules: any;
36
- };
37
- 'schema-relay': {
38
- languageOptions: {
39
- parser: {
40
- parseForESLint: typeof parseForESLint;
41
- meta: {
42
- name: string;
43
- version: string;
44
- };
45
- };
46
- };
47
- rules: any;
48
- };
49
- 'schema-all': {
50
- languageOptions: {
51
- parser: {
52
- parseForESLint: typeof parseForESLint;
53
- meta: {
54
- name: string;
55
- version: string;
56
- };
57
- };
58
- };
59
- rules: any;
60
- };
61
- 'schema-recommended': {
62
- languageOptions: {
63
- parser: {
64
- parseForESLint: typeof parseForESLint;
65
- meta: {
66
- name: string;
67
- version: string;
68
- };
69
- };
70
- };
71
- rules: any;
72
- };
73
- };
74
-
75
- export { flatConfigs };
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var flat_configs_exports = {};
17
- __export(flat_configs_exports, {
18
- flatConfigs: () => flatConfigs
19
- });
20
- module.exports = __toCommonJS(flat_configs_exports);
21
- var import_configs = require("./configs/index.js"), import_parser = require("./parser.js");
22
- const languageOptions = { parser: import_parser.parser }, flatConfigs = {
23
- "operations-all": {
24
- languageOptions,
25
- rules: {
26
- ...import_configs.configs["operations-recommended"].rules,
27
- ...import_configs.configs["operations-all"].rules
28
- }
29
- },
30
- "operations-recommended": {
31
- languageOptions,
32
- rules: import_configs.configs["operations-recommended"].rules
33
- },
34
- "schema-relay": {
35
- languageOptions,
36
- rules: import_configs.configs["schema-relay"].rules
37
- },
38
- "schema-all": {
39
- languageOptions,
40
- rules: {
41
- ...import_configs.configs["schema-recommended"].rules,
42
- ...import_configs.configs["schema-all"].rules
43
- }
44
- },
45
- "schema-recommended": {
46
- languageOptions,
47
- rules: import_configs.configs["schema-recommended"].rules
48
- }
49
- };
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- flatConfigs
53
- });
@@ -1,75 +0,0 @@
1
- import { parseForESLint } from './parser.js';
2
- import './types.js';
3
- import 'eslint';
4
- import 'estree';
5
- import 'graphql';
6
- import 'graphql-config';
7
- import 'json-schema-to-ts';
8
- import './estree-converter/types.js';
9
- import './siblings.js';
10
- import '@graphql-tools/utils';
11
-
12
- declare const flatConfigs: {
13
- 'operations-all': {
14
- languageOptions: {
15
- parser: {
16
- parseForESLint: typeof parseForESLint;
17
- meta: {
18
- name: string;
19
- version: string;
20
- };
21
- };
22
- };
23
- rules: any;
24
- };
25
- 'operations-recommended': {
26
- languageOptions: {
27
- parser: {
28
- parseForESLint: typeof parseForESLint;
29
- meta: {
30
- name: string;
31
- version: string;
32
- };
33
- };
34
- };
35
- rules: any;
36
- };
37
- 'schema-relay': {
38
- languageOptions: {
39
- parser: {
40
- parseForESLint: typeof parseForESLint;
41
- meta: {
42
- name: string;
43
- version: string;
44
- };
45
- };
46
- };
47
- rules: any;
48
- };
49
- 'schema-all': {
50
- languageOptions: {
51
- parser: {
52
- parseForESLint: typeof parseForESLint;
53
- meta: {
54
- name: string;
55
- version: string;
56
- };
57
- };
58
- };
59
- rules: any;
60
- };
61
- 'schema-recommended': {
62
- languageOptions: {
63
- parser: {
64
- parseForESLint: typeof parseForESLint;
65
- meta: {
66
- name: string;
67
- version: string;
68
- };
69
- };
70
- };
71
- rules: any;
72
- };
73
- };
74
-
75
- export { flatConfigs };
@@ -1,34 +0,0 @@
1
- import "./chunk-UIAXBAMD.js";
2
- import { configs } from "./configs/index.js";
3
- import { parser } from "./parser.js";
4
- const languageOptions = { parser }, flatConfigs = {
5
- "operations-all": {
6
- languageOptions,
7
- rules: {
8
- ...configs["operations-recommended"].rules,
9
- ...configs["operations-all"].rules
10
- }
11
- },
12
- "operations-recommended": {
13
- languageOptions,
14
- rules: configs["operations-recommended"].rules
15
- },
16
- "schema-relay": {
17
- languageOptions,
18
- rules: configs["schema-relay"].rules
19
- },
20
- "schema-all": {
21
- languageOptions,
22
- rules: {
23
- ...configs["schema-recommended"].rules,
24
- ...configs["schema-all"].rules
25
- }
26
- },
27
- "schema-recommended": {
28
- languageOptions,
29
- rules: configs["schema-recommended"].rules
30
- }
31
- };
32
- export {
33
- flatConfigs
34
- };