From f59a9829c4398f861fa2f70af911b46c9164c9ca Mon Sep 17 00:00:00 2001 From: Shinigami Date: Wed, 1 Feb 2023 15:08:57 +0100 Subject: [PATCH] Add GraphQL plugin (#168) --- package.json | 12 + pnpm-lock.yaml | 765 ++++++++++++++++++ .../generate-rule-files/src/plugins-map.ts | 6 + src/config/extends/eslint-plugin-graphql.d.ts | 11 + src/config/extends/index.d.ts | 2 + src/config/plugin.d.ts | 1 + src/rules/graphql-eslint/alphabetize.d.ts | 96 +++ .../graphql-eslint/description-style.d.ts | 41 + .../executable-definitions.d.ts | 25 + .../fields-on-correct-type.d.ts | 25 + .../fragments-on-composite-type.d.ts | 25 + src/rules/graphql-eslint/index.d.ts | 130 +++ src/rules/graphql-eslint/input-name.d.ts | 59 ++ .../graphql-eslint/known-argument-names.d.ts | 25 + .../graphql-eslint/known-directives.d.ts | 47 ++ .../graphql-eslint/known-fragment-names.d.ts | 25 + .../graphql-eslint/known-type-names.d.ts | 25 + .../lone-anonymous-operation.d.ts | 25 + .../lone-executable-definition.d.ts | 58 ++ .../lone-schema-definition.d.ts | 25 + .../match-document-filename.d.ts | 67 ++ .../graphql-eslint/naming-convention.d.ts | 130 +++ .../no-anonymous-operations.d.ts | 22 + ...se-insensitive-enum-values-duplicates.d.ts | 22 + src/rules/graphql-eslint/no-deprecated.d.ts | 22 + .../graphql-eslint/no-duplicate-fields.d.ts | 22 + .../graphql-eslint/no-fragment-cycles.d.ts | 25 + .../no-hashtag-description.d.ts | 25 + .../no-one-place-fragments.d.ts | 22 + src/rules/graphql-eslint/no-root-type.d.ts | 43 + .../no-scalar-result-type-on-mutation.d.ts | 22 + .../graphql-eslint/no-typename-prefix.d.ts | 22 + .../no-undefined-variables.d.ts | 25 + .../graphql-eslint/no-unreachable-types.d.ts | 22 + .../graphql-eslint/no-unused-fields.d.ts | 22 + .../graphql-eslint/no-unused-fragments.d.ts | 25 + .../graphql-eslint/no-unused-variables.d.ts | 25 + .../one-field-subscriptions.d.ts | 25 + .../overlapping-fields-can-be-merged.d.ts | 25 + .../possible-fragment-spread.d.ts | 25 + .../possible-type-extension.d.ts | 25 + .../provided-required-arguments.d.ts | 25 + src/rules/graphql-eslint/relay-arguments.d.ts | 80 ++ .../relay-connection-types.d.ts | 37 + .../graphql-eslint/relay-edge-types.d.ts | 76 ++ src/rules/graphql-eslint/relay-page-info.d.ts | 34 + .../require-deprecation-date.d.ts | 42 + .../require-deprecation-reason.d.ts | 22 + .../graphql-eslint/require-description.d.ts | 99 +++ ...ield-of-type-query-in-mutation-result.d.ts | 25 + .../require-id-when-available.d.ts | 47 ++ .../require-nullable-fields-with-oneof.d.ts | 22 + .../require-type-pattern-with-oneof.d.ts | 22 + src/rules/graphql-eslint/scalar-leafs.d.ts | 25 + .../graphql-eslint/selection-set-depth.d.ts | 44 + .../graphql-eslint/strict-id-in-types.d.ts | 62 ++ .../graphql-eslint/unique-argument-names.d.ts | 25 + .../unique-directive-names-per-location.d.ts | 25 + .../unique-directive-names.d.ts | 25 + .../unique-enum-value-names.d.ts | 25 + .../unique-field-definition-names.d.ts | 25 + .../graphql-eslint/unique-fragment-name.d.ts | 22 + .../unique-input-field-names.d.ts | 25 + .../graphql-eslint/unique-operation-name.d.ts | 22 + .../unique-operation-types.d.ts | 25 + .../graphql-eslint/unique-type-names.d.ts | 25 + .../graphql-eslint/unique-variable-names.d.ts | 25 + .../value-literals-of-correct-type.d.ts | 25 + .../variables-are-input-types.d.ts | 25 + .../variables-in-allowed-position.d.ts | 25 + src/rules/index.d.ts | 2 + 71 files changed, 3099 insertions(+) create mode 100644 src/config/extends/eslint-plugin-graphql.d.ts create mode 100644 src/rules/graphql-eslint/alphabetize.d.ts create mode 100644 src/rules/graphql-eslint/description-style.d.ts create mode 100644 src/rules/graphql-eslint/executable-definitions.d.ts create mode 100644 src/rules/graphql-eslint/fields-on-correct-type.d.ts create mode 100644 src/rules/graphql-eslint/fragments-on-composite-type.d.ts create mode 100644 src/rules/graphql-eslint/index.d.ts create mode 100644 src/rules/graphql-eslint/input-name.d.ts create mode 100644 src/rules/graphql-eslint/known-argument-names.d.ts create mode 100644 src/rules/graphql-eslint/known-directives.d.ts create mode 100644 src/rules/graphql-eslint/known-fragment-names.d.ts create mode 100644 src/rules/graphql-eslint/known-type-names.d.ts create mode 100644 src/rules/graphql-eslint/lone-anonymous-operation.d.ts create mode 100644 src/rules/graphql-eslint/lone-executable-definition.d.ts create mode 100644 src/rules/graphql-eslint/lone-schema-definition.d.ts create mode 100644 src/rules/graphql-eslint/match-document-filename.d.ts create mode 100644 src/rules/graphql-eslint/naming-convention.d.ts create mode 100644 src/rules/graphql-eslint/no-anonymous-operations.d.ts create mode 100644 src/rules/graphql-eslint/no-case-insensitive-enum-values-duplicates.d.ts create mode 100644 src/rules/graphql-eslint/no-deprecated.d.ts create mode 100644 src/rules/graphql-eslint/no-duplicate-fields.d.ts create mode 100644 src/rules/graphql-eslint/no-fragment-cycles.d.ts create mode 100644 src/rules/graphql-eslint/no-hashtag-description.d.ts create mode 100644 src/rules/graphql-eslint/no-one-place-fragments.d.ts create mode 100644 src/rules/graphql-eslint/no-root-type.d.ts create mode 100644 src/rules/graphql-eslint/no-scalar-result-type-on-mutation.d.ts create mode 100644 src/rules/graphql-eslint/no-typename-prefix.d.ts create mode 100644 src/rules/graphql-eslint/no-undefined-variables.d.ts create mode 100644 src/rules/graphql-eslint/no-unreachable-types.d.ts create mode 100644 src/rules/graphql-eslint/no-unused-fields.d.ts create mode 100644 src/rules/graphql-eslint/no-unused-fragments.d.ts create mode 100644 src/rules/graphql-eslint/no-unused-variables.d.ts create mode 100644 src/rules/graphql-eslint/one-field-subscriptions.d.ts create mode 100644 src/rules/graphql-eslint/overlapping-fields-can-be-merged.d.ts create mode 100644 src/rules/graphql-eslint/possible-fragment-spread.d.ts create mode 100644 src/rules/graphql-eslint/possible-type-extension.d.ts create mode 100644 src/rules/graphql-eslint/provided-required-arguments.d.ts create mode 100644 src/rules/graphql-eslint/relay-arguments.d.ts create mode 100644 src/rules/graphql-eslint/relay-connection-types.d.ts create mode 100644 src/rules/graphql-eslint/relay-edge-types.d.ts create mode 100644 src/rules/graphql-eslint/relay-page-info.d.ts create mode 100644 src/rules/graphql-eslint/require-deprecation-date.d.ts create mode 100644 src/rules/graphql-eslint/require-deprecation-reason.d.ts create mode 100644 src/rules/graphql-eslint/require-description.d.ts create mode 100644 src/rules/graphql-eslint/require-field-of-type-query-in-mutation-result.d.ts create mode 100644 src/rules/graphql-eslint/require-id-when-available.d.ts create mode 100644 src/rules/graphql-eslint/require-nullable-fields-with-oneof.d.ts create mode 100644 src/rules/graphql-eslint/require-type-pattern-with-oneof.d.ts create mode 100644 src/rules/graphql-eslint/scalar-leafs.d.ts create mode 100644 src/rules/graphql-eslint/selection-set-depth.d.ts create mode 100644 src/rules/graphql-eslint/strict-id-in-types.d.ts create mode 100644 src/rules/graphql-eslint/unique-argument-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-directive-names-per-location.d.ts create mode 100644 src/rules/graphql-eslint/unique-directive-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-enum-value-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-field-definition-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-fragment-name.d.ts create mode 100644 src/rules/graphql-eslint/unique-input-field-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-operation-name.d.ts create mode 100644 src/rules/graphql-eslint/unique-operation-types.d.ts create mode 100644 src/rules/graphql-eslint/unique-type-names.d.ts create mode 100644 src/rules/graphql-eslint/unique-variable-names.d.ts create mode 100644 src/rules/graphql-eslint/value-literals-of-correct-type.d.ts create mode 100644 src/rules/graphql-eslint/variables-are-input-types.d.ts create mode 100644 src/rules/graphql-eslint/variables-in-allowed-position.d.ts diff --git a/package.json b/package.json index 0e207ab8..f0dc8814 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "tsconfig.json" ], "devDependencies": { + "@graphql-eslint/eslint-plugin": "~3.15.0", "@intlify/eslint-plugin-vue-i18n": "~2.0.0", "@poppinss/cliui": "~3.0.5", "@types/eslint": "~8.4.10", @@ -80,7 +81,9 @@ "eslint-plugin-vue": "~9.9.0", "eslint-plugin-vue-pug": "~0.5.5", "expect-type": "~0.15.0", + "graphql": "~16.6.0", "json-schema": "~0.4.0", + "json-schema-to-ts": "~2.6.2", "json-schema-to-typescript": "~11.0.3", "prettier": "2.8.3", "prettier-plugin-organize-imports": "~3.2.2", @@ -91,6 +94,15 @@ "vitest": "~0.28.3", "vue-eslint-parser": "~9.1.0" }, + "pnpm": { + "peerDependencyRules": { + "ignoreMissing": [ + "@babel/core", + "cosmiconfig-toml-loader", + "cosmiconfig-typescript-loader" + ] + } + }, "packageManager": "pnpm@7.26.3", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 005efed7..311468f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,6 +1,7 @@ lockfileVersion: 5.4 specifiers: + '@graphql-eslint/eslint-plugin': ~3.15.0 '@intlify/eslint-plugin-vue-i18n': ~2.0.0 '@poppinss/cliui': ~3.0.5 '@types/eslint': ~8.4.10 @@ -30,7 +31,9 @@ specifiers: eslint-plugin-vue: ~9.9.0 eslint-plugin-vue-pug: ~0.5.5 expect-type: ~0.15.0 + graphql: ~16.6.0 json-schema: ~0.4.0 + json-schema-to-ts: ~2.6.2 json-schema-to-typescript: ~11.0.3 prettier: 2.8.3 prettier-plugin-organize-imports: ~3.2.2 @@ -42,6 +45,7 @@ specifiers: vue-eslint-parser: ~9.1.0 devDependencies: + '@graphql-eslint/eslint-plugin': 3.15.0_ykzowzmb7rcumunkscnbisnkom '@intlify/eslint-plugin-vue-i18n': 2.0.0_eslint@8.33.0 '@poppinss/cliui': 3.0.5 '@types/eslint': 8.4.10 @@ -71,7 +75,9 @@ devDependencies: eslint-plugin-vue: 9.9.0_eslint@8.33.0 eslint-plugin-vue-pug: 0.5.5_tygcqzbe3npvtnu2w2c2ee5se4 expect-type: 0.15.0 + graphql: 16.6.0 json-schema: 0.4.0 + json-schema-to-ts: 2.6.2 json-schema-to-typescript: 11.0.3 prettier: 2.8.3 prettier-plugin-organize-imports: 3.2.2_ioxdq35luteszuxmt2jhnqjeca @@ -84,6 +90,15 @@ devDependencies: packages: + /@ardatan/sync-fetch/0.0.1: + resolution: {integrity: sha512-xhlTqH0m31mnsG0tIP4ETgfSB6gXDaYYsUWTrlUV93fFQPI9dd8hE0Ot6MHLCtqgB32hwJAC3YZMWlXZw7AleA==} + engines: {node: '>=14'} + dependencies: + node-fetch: 2.6.9 + transitivePeerDependencies: + - encoding + dev: true + /@babel/code-frame/7.18.6: resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} engines: {node: '>=6.9.0'} @@ -91,6 +106,52 @@ packages: '@babel/highlight': 7.18.6 dev: true + /@babel/generator/7.20.14: + resolution: {integrity: sha512-AEmuXHdcD3A52HHXxaTmYlb8q/xMEhoRP67B3T4Oq7lbmSoqroMZzjnGj3+i1io3pdnF8iBYVu4Ilj+c4hBxYg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.7 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + dev: true + + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/types': 7.20.7 + dev: true + + /@babel/helper-hoist-variables/7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.7 + dev: true + + /@babel/helper-plugin-utils/7.20.2: + resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-split-export-declaration/7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.7 + dev: true + + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-identifier/7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} @@ -105,6 +166,26 @@ packages: js-tokens: 4.0.0 dev: true + /@babel/parser/7.20.13: + resolution: {integrity: sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.7 + dev: true + + /@babel/plugin-syntax-import-assertions/7.20.0: + resolution: {integrity: sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/helper-plugin-utils': 7.20.2 + dev: true + /@babel/runtime/7.20.13: resolution: {integrity: sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==} engines: {node: '>=6.9.0'} @@ -112,6 +193,42 @@ packages: regenerator-runtime: 0.13.11 dev: true + /@babel/template/7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.20.13 + '@babel/types': 7.20.7 + dev: true + + /@babel/traverse/7.20.13: + resolution: {integrity: sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.14 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.13 + '@babel/types': 7.20.7 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types/7.20.7: + resolution: {integrity: sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: true + /@bcherny/json-schema-ref-parser/9.0.9: resolution: {integrity: sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==} dependencies: @@ -401,6 +518,285 @@ packages: - supports-color dev: true + /@graphql-eslint/eslint-plugin/3.15.0_ykzowzmb7rcumunkscnbisnkom: + resolution: {integrity: sha512-0sCHsbD07sCAHLKr/89i0ZcKasAbPps9OcWcvBtBoyuyvINWQlTrG0eqIwo4n5pOdNLw1yCfk+R7AwRYJ8m+MQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + '@babel/code-frame': 7.18.6 + '@graphql-tools/code-file-loader': 7.3.17_graphql@16.6.0 + '@graphql-tools/graphql-tag-pluck': 7.4.3_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + chalk: 4.1.2 + debug: 4.3.4 + fast-glob: 3.2.12 + graphql: 16.6.0 + graphql-config: 4.4.0_ykzowzmb7rcumunkscnbisnkom + graphql-depth-limit: 1.1.0_graphql@16.6.0 + lodash.lowercase: 4.3.0 + tslib: 2.5.0 + transitivePeerDependencies: + - '@babel/core' + - '@types/node' + - bufferutil + - cosmiconfig-toml-loader + - cosmiconfig-typescript-loader + - encoding + - supports-color + - utf-8-validate + dev: true + + /@graphql-tools/batch-execute/8.5.15_graphql@16.6.0: + resolution: {integrity: sha512-qb12M8XCK6SBJmZDS8Lzd4PVJFsIwNUkYmFuqcTiBqOI/WsoDlQDZI++ghRpGcusLkL9uzcIOTT/61OeHhsaLg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + dataloader: 2.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + dev: true + + /@graphql-tools/code-file-loader/7.3.17_graphql@16.6.0: + resolution: {integrity: sha512-LqJgYJCau1/uIOZmnFixl8yJT99jTjQlNhUP3Vj0oQ0HODdPUKUjWA87SkwZR1TJzX19iKf/iGzfbLCAAhFRbA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/graphql-tag-pluck': 7.4.3_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + globby: 11.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + unixify: 1.0.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + dev: true + + /@graphql-tools/delegate/9.0.24_graphql@16.6.0: + resolution: {integrity: sha512-8+ircuaz51+yLip2qBBYenNlV8xiP7i44C+H+kO82ARmo2h47/q488K38DMbOL5//7G2Qt0GEZwTEF4h8ICGJQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/batch-execute': 8.5.15_graphql@16.6.0 + '@graphql-tools/executor': 0.0.12_graphql@16.6.0 + '@graphql-tools/schema': 9.0.14_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + dataloader: 2.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + dev: true + + /@graphql-tools/executor-graphql-ws/0.0.7_graphql@16.6.0: + resolution: {integrity: sha512-C6EExKoukn4vu3BbvlqsqtC91F4pTLPDZvRceYjpFzTCQSGFSjfrxQGP/haGlemXVRpIDxBy7wpXoQlsF8UmFA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@repeaterjs/repeater': 3.0.4 + '@types/ws': 8.5.4 + graphql: 16.6.0 + graphql-ws: 5.11.2_graphql@16.6.0 + isomorphic-ws: 5.0.0_ws@8.12.0 + tslib: 2.5.0 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@graphql-tools/executor-http/0.1.3_ykzowzmb7rcumunkscnbisnkom: + resolution: {integrity: sha512-Bv4OqEbE4z5FG7dVrVKWvwkL0QKASWgEz3524ll3qDtHEUyE1lrItA+qVBxj0mcAV5tP0C8TNglZe8Ib/iTNzA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@repeaterjs/repeater': 3.0.4 + '@whatwg-node/fetch': 0.6.5_@types+node@18.11.18 + dset: 3.1.2 + extract-files: 11.0.0 + graphql: 16.6.0 + meros: 1.2.1_@types+node@18.11.18 + tslib: 2.5.0 + value-or-promise: 1.0.12 + transitivePeerDependencies: + - '@types/node' + dev: true + + /@graphql-tools/executor-legacy-ws/0.0.6_graphql@16.6.0: + resolution: {integrity: sha512-L1hRuSvBUCNerYDhfeSZXFeqliDlnNXa3fDHTp7efI3Newpbevqa19Fm0mVzsCL7gqIKOwzrPORwh7kOVE/vew==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@types/ws': 8.5.4 + graphql: 16.6.0 + isomorphic-ws: 5.0.0_ws@8.12.0 + tslib: 2.5.0 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@graphql-tools/executor/0.0.12_graphql@16.6.0: + resolution: {integrity: sha512-bWpZcYRo81jDoTVONTnxS9dDHhEkNVjxzvFCH4CRpuyzD3uL+5w3MhtxIh24QyWm4LvQ4f+Bz3eMV2xU2I5+FA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@graphql-typed-document-node/core': 3.1.1_graphql@16.6.0 + '@repeaterjs/repeater': 3.0.4 + graphql: 16.6.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + dev: true + + /@graphql-tools/graphql-file-loader/7.5.14_graphql@16.6.0: + resolution: {integrity: sha512-JGer4g57kq4wtsvqv8uZsT4ZG1lLsz1x5yHDfSj2OxyiWw2f1jFkzgby7Ut3H2sseJiQzeeDYZcbm06qgR32pg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/import': 6.7.15_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + globby: 11.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + unixify: 1.0.0 + dev: true + + /@graphql-tools/graphql-tag-pluck/7.4.3_graphql@16.6.0: + resolution: {integrity: sha512-w+nrJVQw+NTuaZNQG5AwSh4Qe+urP/s4rUz5s1T007rDnv1kvkiX+XHOCnIfJzXOTuvFmG4GGYw/x0CuSRaGZQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@babel/parser': 7.20.13 + '@babel/plugin-syntax-import-assertions': 7.20.0 + '@babel/traverse': 7.20.13 + '@babel/types': 7.20.7 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + tslib: 2.5.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + dev: true + + /@graphql-tools/import/6.7.15_graphql@16.6.0: + resolution: {integrity: sha512-WNhvauAt2I2iUg+JdQK5oQebKLXqUZWe8naP13K1jOkbTQT7hK3P/4I9AaVmzt0KXRJW5Uow3RgdHZ7eUBKVsA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + resolve-from: 5.0.0 + tslib: 2.5.0 + dev: true + + /@graphql-tools/json-file-loader/7.4.15_graphql@16.6.0: + resolution: {integrity: sha512-pH+hbsDetcEpj+Tmi7ZRUkxzJez2DLdSQuvK5Qi38FX/Nz/5nZKRfW9nqIptGYbuS9+2JPrt9WWNn1aGtegIFQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + globby: 11.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + unixify: 1.0.0 + dev: true + + /@graphql-tools/load/7.8.10_graphql@16.6.0: + resolution: {integrity: sha512-Mc1p7ZSxrW5yGG3BLQnhiL8RPG0HdxFVoHV7fpx2adp4o1V7BzDjKRSbCnAxShA1wA4n8wbA+n7NTC0edi4eNA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/schema': 9.0.14_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + p-limit: 3.1.0 + tslib: 2.5.0 + dev: true + + /@graphql-tools/merge/8.3.16_graphql@16.6.0: + resolution: {integrity: sha512-In0kcOZcPIpYOKaqdrJ3thdLPE7TutFnL9tbrHUy2zCinR2O/blpRC48jPckcs0HHrUQ0pGT4HqvzMkZUeEBAw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + tslib: 2.5.0 + dev: true + + /@graphql-tools/schema/9.0.14_graphql@16.6.0: + resolution: {integrity: sha512-U6k+HY3Git+dsOEhq+dtWQwYg2CAgue8qBvnBXoKu5eEeH284wymMUoNm0e4IycOgMCJANVhClGEBIkLRu3FQQ==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/merge': 8.3.16_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + dev: true + + /@graphql-tools/url-loader/7.17.7_ykzowzmb7rcumunkscnbisnkom: + resolution: {integrity: sha512-SulOTzmUenj2+wt7XzFh2xakeYUuuzX7nDrjSlgmn/gKD4ydhzCkDz+WXXyvvEq2YmBd7x/iJMeL4N3wAZWk3w==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@ardatan/sync-fetch': 0.0.1 + '@graphql-tools/delegate': 9.0.24_graphql@16.6.0 + '@graphql-tools/executor-graphql-ws': 0.0.7_graphql@16.6.0 + '@graphql-tools/executor-http': 0.1.3_ykzowzmb7rcumunkscnbisnkom + '@graphql-tools/executor-legacy-ws': 0.0.6_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@graphql-tools/wrap': 9.3.3_graphql@16.6.0 + '@types/ws': 8.5.4 + '@whatwg-node/fetch': 0.6.5_@types+node@18.11.18 + graphql: 16.6.0 + isomorphic-ws: 5.0.0_ws@8.12.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + ws: 8.12.0 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + dev: true + + /@graphql-tools/utils/9.1.4_graphql@16.6.0: + resolution: {integrity: sha512-hgIeLt95h9nQgQuzbbdhuZmh+8WV7RZ/6GbTj6t3IU4Zd2zs9yYJ2jgW/krO587GMOY8zCwrjNOMzD40u3l7Vg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + graphql: 16.6.0 + tslib: 2.5.0 + dev: true + + /@graphql-tools/wrap/9.3.3_graphql@16.6.0: + resolution: {integrity: sha512-KN+mWFXqUAZVYWotp396lAestMZx7SYwvCWwi6D9HNy89PLK2XYBfXKlvTUYZ5zEC5s2Qhc/DbnHJ3hSFyX7Gg==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/delegate': 9.0.24_graphql@16.6.0 + '@graphql-tools/schema': 9.0.14_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + graphql: 16.6.0 + tslib: 2.5.0 + value-or-promise: 1.0.12 + dev: true + + /@graphql-typed-document-node/core/3.1.1_graphql@16.6.0: + resolution: {integrity: sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + graphql: 16.6.0 + dev: true + /@humanwhocodes/config-array/0.11.8: resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} engines: {node: '>=10.10.0'} @@ -485,6 +881,36 @@ packages: '@intlify/shared': 9.2.2 dev: true + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + /@jsdevtools/ono/7.1.3: resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} dev: true @@ -510,6 +936,32 @@ packages: fastq: 1.15.0 dev: true + /@peculiar/asn1-schema/2.3.3: + resolution: {integrity: sha512-6GptMYDMyWBHTUKndHaDsRZUO/XMSgIns2krxcm2L7SEExRHwawFvSwNBhqNPR9HJwv3MruAiF1bhN0we6j6GQ==} + dependencies: + asn1js: 3.0.5 + pvtsutils: 1.3.2 + tslib: 2.5.0 + dev: true + + /@peculiar/json-schema/1.1.12: + resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==} + engines: {node: '>=8.0.0'} + dependencies: + tslib: 2.5.0 + dev: true + + /@peculiar/webcrypto/1.4.1: + resolution: {integrity: sha512-eK4C6WTNYxoI7JOabMoZICiyqRRtJB220bh0Mbj5RwRycleZf9BPyZoxsTvpP0FpmVS2aS13NKOuh5/tN3sIRw==} + engines: {node: '>=10.12.0'} + dependencies: + '@peculiar/asn1-schema': 2.3.3 + '@peculiar/json-schema': 1.1.12 + pvtsutils: 1.3.2 + tslib: 2.5.0 + webcrypto-core: 1.7.5 + dev: true + /@pkgr/utils/2.3.1: resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -541,6 +993,10 @@ packages: kleur: 4.1.5 dev: true + /@repeaterjs/repeater/3.0.4: + resolution: {integrity: sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA==} + dev: true + /@types/acorn/4.0.6: resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} dependencies: @@ -643,6 +1099,12 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true + /@types/ws/8.5.4: + resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} + dependencies: + '@types/node': 18.11.18 + dev: true + /@typescript-eslint/eslint-plugin/5.50.0_go4drrxstycfikanvu45pi4vgq: resolution: {integrity: sha512-vwksQWSFZiUhgq3Kv7o1Jcj0DUNylwnIlGvKvLLYsq8pAWha6/WCnXUeaSoNNha/K7QSf2+jvmkxggC1u3pIwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -818,6 +1280,33 @@ packages: pretty-format: 27.5.1 dev: true + /@whatwg-node/events/0.0.2: + resolution: {integrity: sha512-WKj/lI4QjnLuPrim0cfO7i+HsDSXHxNv1y0CrJhdntuO3hxWZmnXCwNDnwOvry11OjRin6cgWNF+j/9Pn8TN4w==} + dev: true + + /@whatwg-node/fetch/0.6.5_@types+node@18.11.18: + resolution: {integrity: sha512-3XQ78RAMX8Az0LlUqMoGM3jbT+FE0S+IKr4yiTiqzQ5S/pNxD52K/kFLcLQiEbL+3rkk/glCHqjxF1QI5155Ig==} + dependencies: + '@peculiar/webcrypto': 1.4.1 + '@whatwg-node/node-fetch': 0.0.1_@types+node@18.11.18 + busboy: 1.6.0 + urlpattern-polyfill: 6.0.2 + web-streams-polyfill: 3.2.1 + transitivePeerDependencies: + - '@types/node' + dev: true + + /@whatwg-node/node-fetch/0.0.1_@types+node@18.11.18: + resolution: {integrity: sha512-dMbh604yf2jl37IzvYGA6z3heQg3dMzlqoNsiNToe46SVmKusfJXGf4KYIuiJTzh9mEEu/uVF//QakUfsLJpwA==} + peerDependencies: + '@types/node': ^18.0.6 + dependencies: + '@types/node': 18.11.18 + '@whatwg-node/events': 0.0.2 + busboy: 1.6.0 + tslib: 2.5.0 + dev: true + /acorn-jsx/5.3.2_acorn@8.8.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -937,6 +1426,20 @@ packages: es-shim-unscopables: 1.0.0 dev: true + /arrify/1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + dev: true + + /asn1js/3.0.5: + resolution: {integrity: sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==} + engines: {node: '>=12.0.0'} + dependencies: + pvtsutils: 1.3.2 + pvutils: 1.1.3 + tslib: 2.5.0 + dev: true + /assertion-error/1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true @@ -998,6 +1501,13 @@ packages: semver: 7.3.8 dev: true + /busboy/1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + dependencies: + streamsearch: 1.1.0 + dev: true + /cac/6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -1229,6 +1739,16 @@ packages: yaml: 1.10.2 dev: true + /cosmiconfig/8.0.0: + resolution: {integrity: sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==} + engines: {node: '>=14'} + dependencies: + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + dev: true + /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1251,6 +1771,10 @@ packages: type: 1.2.0 dev: true + /dataloader/2.1.0: + resolution: {integrity: sha512-qTcEYLen3r7ojZNgVUaRggOI+KM7jrKxXeSHhogh/TWxYMeONEMqY+hmkobiYQozsGIyg9OYVzO4ZIfoB4I0pQ==} + dev: true + /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -1342,6 +1866,11 @@ packages: tslib: 2.5.0 dev: true + /dset/3.1.2: + resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==} + engines: {node: '>=4'} + dev: true + /eastasianwidth/0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true @@ -2245,6 +2774,11 @@ packages: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} dev: true + /extract-files/11.0.0: + resolution: {integrity: sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ==} + engines: {node: ^12.20 || >= 14.13} + dev: true + /fast-deep-equal/3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -2431,6 +2965,11 @@ packages: once: 1.4.0 dev: true + /globals/11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + dev: true + /globals/13.20.0: resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} engines: {node: '>=8'} @@ -2475,6 +3014,61 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphql-config/4.4.0_ykzowzmb7rcumunkscnbisnkom: + resolution: {integrity: sha512-QUrX7R4htnTBTi83a0IlIilWVfiLEG8ANFlHRcxoZiTvOXTbgan67SUdGe1OlopbDuyNgtcy4ladl3Gvk4C36A==} + engines: {node: '>= 10.0.0'} + peerDependencies: + cosmiconfig-toml-loader: ^1.0.0 + cosmiconfig-typescript-loader: ^4.0.0 + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + peerDependenciesMeta: + cosmiconfig-toml-loader: + optional: true + cosmiconfig-typescript-loader: + optional: true + dependencies: + '@graphql-tools/graphql-file-loader': 7.5.14_graphql@16.6.0 + '@graphql-tools/json-file-loader': 7.4.15_graphql@16.6.0 + '@graphql-tools/load': 7.8.10_graphql@16.6.0 + '@graphql-tools/merge': 8.3.16_graphql@16.6.0 + '@graphql-tools/url-loader': 7.17.7_ykzowzmb7rcumunkscnbisnkom + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + cosmiconfig: 8.0.0 + graphql: 16.6.0 + minimatch: 4.2.1 + string-env-interpolation: 1.0.1 + tslib: 2.5.0 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + dev: true + + /graphql-depth-limit/1.1.0_graphql@16.6.0: + resolution: {integrity: sha512-+3B2BaG8qQ8E18kzk9yiSdAa75i/hnnOwgSeAxVJctGQPvmeiLtqKOYF6HETCyRjiF7Xfsyal0HbLlxCQkgkrw==} + engines: {node: '>=6.0.0'} + peerDependencies: + graphql: '*' + dependencies: + arrify: 1.0.1 + graphql: 16.6.0 + dev: true + + /graphql-ws/5.11.2_graphql@16.6.0: + resolution: {integrity: sha512-4EiZ3/UXYcjm+xFGP544/yW1+DVI8ZpKASFbzrV5EDTFWJp0ZvLl4Dy2fSZAzz9imKp5pZMIcjB0x/H69Pv/6w==} + engines: {node: '>=10'} + peerDependencies: + graphql: '>=0.11 <=16' + dependencies: + graphql: 16.6.0 + dev: true + + /graphql/16.6.0: + resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + dev: true + /has-bigints/1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true @@ -2804,6 +3398,14 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true + /isomorphic-ws/5.0.0_ws@8.12.0: + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + dependencies: + ws: 8.12.0 + dev: true + /js-sdsl/4.3.0: resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==} dev: true @@ -2829,6 +3431,12 @@ packages: hasBin: true dev: true + /jsesc/2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + dev: true + /jsesc/3.0.2: resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} engines: {node: '>=6'} @@ -2839,6 +3447,16 @@ packages: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true + /json-schema-to-ts/2.6.2: + resolution: {integrity: sha512-RrcvhZUcTAtfMVSvHIq3h/tELToha68V/1kGeQ2ggBv/4Bv31Zjbqis+b+Hiwibj6GO5WLA9PE4X93C8VTJ1TA==} + engines: {node: '>=16'} + dependencies: + '@babel/runtime': 7.20.13 + '@types/json-schema': 7.0.11 + ts-algebra: 1.1.1 + ts-toolbelt: 9.6.0 + dev: true + /json-schema-to-typescript/11.0.3: resolution: {integrity: sha512-EaEE9Y4VZ8b9jW5zce5a9L3+p4C9AqgIRHbNVDJahfMnoKzcd4sDb98BLxLdQhJEuRAXyKLg4H66NKm80W8ilg==} engines: {node: '>=12.0.0'} @@ -2935,6 +3553,10 @@ packages: p-locate: 5.0.0 dev: true + /lodash.lowercase/4.3.0: + resolution: {integrity: sha512-UcvP1IZYyDKyEL64mmrwoA1AbFu5ahojhTtkOUr1K9dbuxzS9ev8i4TxMMGCqRC9TE8uDaSoufNAXxRPNTseVA==} + dev: true + /lodash.merge/4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true @@ -3113,6 +3735,18 @@ packages: engines: {node: '>= 8'} dev: true + /meros/1.2.1_@types+node@18.11.18: + resolution: {integrity: sha512-R2f/jxYqCAGI19KhAvaxSOxALBMkaXWH2a7rOyqQw+ZmizX5bKkEYWLzdhC+U82ZVVPVp6MCXe3EkVligh+12g==} + engines: {node: '>=13'} + peerDependencies: + '@types/node': '>=13' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 18.11.18 + dev: true + /micromark-core-commonmark/1.0.6: resolution: {integrity: sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==} dependencies: @@ -3405,6 +4039,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch/4.2.1: + resolution: {integrity: sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 1.1.11 + dev: true + /minimatch/5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -3477,6 +4118,18 @@ packages: tslib: 2.5.0 dev: true + /node-fetch/2.6.9: + resolution: {integrity: sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + /normalize-package-data/2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -3486,6 +4139,13 @@ packages: validate-npm-package-license: 3.0.4 dev: true + /normalize-path/2.1.1: + resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} + engines: {node: '>=0.10.0'} + dependencies: + remove-trailing-separator: 1.1.0 + dev: true + /nth-check/2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: @@ -3804,6 +4464,17 @@ packages: engines: {node: '>=6'} dev: true + /pvtsutils/1.3.2: + resolution: {integrity: sha512-+Ipe2iNUyrZz+8K/2IOo+kKikdtfhRKzNpQbruF2URmqPtoqAs8g3xS7TJvFF2GcPXjh7DkqMnpVveRFq4PgEQ==} + dependencies: + tslib: 2.5.0 + dev: true + + /pvutils/1.1.3: + resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} + engines: {node: '>=6.0.0'} + dev: true + /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -3888,11 +4559,20 @@ packages: unified: 10.1.2 dev: true + /remove-trailing-separator/1.1.0: + resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} + dev: true + /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} dev: true + /resolve-from/5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true @@ -4087,6 +4767,15 @@ packages: resolution: {integrity: sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==} dev: true + /streamsearch/1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + dev: true + + /string-env-interpolation/1.0.1: + resolution: {integrity: sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg==} + dev: true + /string-width/4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4237,6 +4926,11 @@ packages: engines: {node: '>=14.0.0'} dev: true + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: true + /to-regex-range/5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -4244,15 +4938,29 @@ packages: is-number: 7.0.0 dev: true + /tr46/0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + /trough/2.1.0: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true + /ts-algebra/1.1.1: + resolution: {integrity: sha512-W43a3/BN0Tp4SgRNERQF/QPVuY1rnHkgCr/fISLY0Ycu05P0NWPYRuViU8JFn+pFZuY6/zp9TgET1fxMzppR/Q==} + dependencies: + ts-toolbelt: 9.6.0 + dev: true + /ts-dedent/2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} engines: {node: '>=6.10'} dev: true + /ts-toolbelt/9.6.0: + resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} + dev: true + /tsconfig-paths/3.14.1: resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} dependencies: @@ -4414,6 +5122,13 @@ packages: unist-util-visit-parents: 5.1.3 dev: true + /unixify/1.0.0: + resolution: {integrity: sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==} + engines: {node: '>=0.10.0'} + dependencies: + normalize-path: 2.1.1 + dev: true + /upper-case-first/2.0.2: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} dependencies: @@ -4432,6 +5147,12 @@ packages: punycode: 2.3.0 dev: true + /urlpattern-polyfill/6.0.2: + resolution: {integrity: sha512-5vZjFlH9ofROmuWmXM9yj2wljYKgWstGwe8YTyiqM7hVum/g9LyCizPZtb3UqsuppVwety9QJmfc42VggLpTgg==} + dependencies: + braces: 3.0.2 + dev: true + /util-deprecate/1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true @@ -4454,6 +5175,11 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /value-or-promise/1.0.12: + resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} + engines: {node: '>=12'} + dev: true + /vfile-location/4.0.1: resolution: {integrity: sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==} dependencies: @@ -4616,6 +5342,32 @@ packages: - supports-color dev: true + /web-streams-polyfill/3.2.1: + resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} + engines: {node: '>= 8'} + dev: true + + /webcrypto-core/1.7.5: + resolution: {integrity: sha512-gaExY2/3EHQlRNNNVSrbG2Cg94Rutl7fAaKILS1w8ZDhGxdFOaw6EbCfHIxPy9vt/xwp5o0VQAx9aySPF6hU1A==} + dependencies: + '@peculiar/asn1-schema': 2.3.3 + '@peculiar/json-schema': 1.1.12 + asn1js: 3.0.5 + pvtsutils: 1.3.2 + tslib: 2.5.0 + dev: true + + /webidl-conversions/3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + + /whatwg-url/5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: @@ -4673,6 +5425,19 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true + /ws/8.12.0: + resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + /xml-name-validator/4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} diff --git a/scripts/generate-rule-files/src/plugins-map.ts b/scripts/generate-rule-files/src/plugins-map.ts index abcb3d0e..bbeda21e 100644 --- a/scripts/generate-rule-files/src/plugins-map.ts +++ b/scripts/generate-rule-files/src/plugins-map.ts @@ -1,3 +1,4 @@ +import * as eslintPluginGraphQl from '@graphql-eslint/eslint-plugin'; import * as eslint from 'eslint'; import * as eslintPluginDeprecation from 'eslint-plugin-deprecation'; // @ts-expect-error @@ -55,6 +56,11 @@ export const PLUGIN_REGISTRY: Readonly> = { name: 'EslintComments', rules: (eslintPluginEslintComments as Plugin).rules, }, + 'graphql-eslint': { + name: 'GraphQL', + prefix: '@graphql-eslint', + rules: eslintPluginGraphQl.rules as Plugin['rules'], + }, jsdoc: { name: 'JSDoc', prefix: 'jsdoc', diff --git a/src/config/extends/eslint-plugin-graphql.d.ts b/src/config/extends/eslint-plugin-graphql.d.ts new file mode 100644 index 00000000..cd7f6436 --- /dev/null +++ b/src/config/extends/eslint-plugin-graphql.d.ts @@ -0,0 +1,11 @@ +/** + * Eslint GraphQL extensions. + * + * @see [Eslint GraphQL extensions](https://the-guild.dev/graphql/eslint/docs/configs) + */ +export type GraphqlExtensions = + | 'plugin:@graphql-eslint/operations-all' + | 'plugin:@graphql-eslint/operations-recommended' + | 'plugin:@graphql-eslint/relay' + | 'plugin:@graphql-eslint/schema-all' + | 'plugin:@graphql-eslint/schema-recommended'; diff --git a/src/config/extends/index.d.ts b/src/config/extends/index.d.ts index bfc589e1..7384d09f 100644 --- a/src/config/extends/index.d.ts +++ b/src/config/extends/index.d.ts @@ -1,6 +1,7 @@ import type { LiteralUnion } from '../../utility-types'; import type { EslintExtensions } from './eslint'; import type { EslintCommentsExtensions } from './eslint-plugin-eslint-comment'; +import type { GraphqlExtensions } from './eslint-plugin-graphql'; import type { ImportExtensions } from './eslint-plugin-import'; import type { JsdocExtensions } from './eslint-plugin-jsdoc'; import type { JsoncExtensions } from './eslint-plugin-jsonc'; @@ -22,6 +23,7 @@ import type { TypescriptEslintExtensions } from './typescript-eslint'; export type KnownExtensions = LiteralUnion< | EslintCommentsExtensions | EslintExtensions + | GraphqlExtensions | ImportExtensions | IntlifyVueI18nExtensions | JsdocExtensions diff --git a/src/config/plugin.d.ts b/src/config/plugin.d.ts index 061f60a7..d951136b 100644 --- a/src/config/plugin.d.ts +++ b/src/config/plugin.d.ts @@ -2,6 +2,7 @@ import type { LiteralUnion } from '../utility-types'; /** Plugin. */ export type Plugin = LiteralUnion< + | '@graphql-eslint' | '@typescript-eslint' | 'deprecation' | 'import' diff --git a/src/rules/graphql-eslint/alphabetize.d.ts b/src/rules/graphql-eslint/alphabetize.d.ts new file mode 100644 index 00000000..ec26984b --- /dev/null +++ b/src/rules/graphql-eslint/alphabetize.d.ts @@ -0,0 +1,96 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + * @maxItems 1 + */ +export type AlphabetizeOption = [ + { + /** + * Fields of `type`, `interface`, and `input`. + * + * @minItems 1 + */ + fields?: [ + ( + | 'ObjectTypeDefinition' + | 'InterfaceTypeDefinition' + | 'InputObjectTypeDefinition' + ), + ...( + | 'ObjectTypeDefinition' + | 'InterfaceTypeDefinition' + | 'InputObjectTypeDefinition' + )[], + ]; + /** + * Values of `enum`. + * + * @minItems 1 + */ + values?: ['EnumTypeDefinition', ...'EnumTypeDefinition'[]]; + /** + * Selections of `fragment` and operations `query`, `mutation` and `subscription`. + * + * @minItems 1 + */ + selections?: [ + 'OperationDefinition' | 'FragmentDefinition', + ...('OperationDefinition' | 'FragmentDefinition')[], + ]; + /** + * Variables of operations `query`, `mutation` and `subscription`. + * + * @minItems 1 + */ + variables?: ['OperationDefinition', ...'OperationDefinition'[]]; + /** + * Arguments of fields and directives. + * + * @minItems 1 + */ + arguments?: [ + 'FieldDefinition' | 'Field' | 'DirectiveDefinition' | 'Directive', + ...('FieldDefinition' | 'Field' | 'DirectiveDefinition' | 'Directive')[], + ]; + /** + * Definitions – `type`, `interface`, `enum`, `scalar`, `input`, `union` and `directive`. + */ + definitions?: boolean; + /** + * Custom order group. Example: `['id', '*', 'createdAt', 'updatedAt']` where `*` says for everything else. + * + * @minItems 2 + */ + groups?: [string, string, ...string[]]; + }, +]; + +/** + * Options. + */ +export type AlphabetizeOptions = AlphabetizeOption; + +/** + * Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more. + * + * @see [alphabetize](https://the-guild.dev/graphql/eslint/rules/alphabetize) + */ +export type AlphabetizeRuleConfig = RuleConfig; + +/** + * Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more. + * + * @see [alphabetize](https://the-guild.dev/graphql/eslint/rules/alphabetize) + */ +export interface AlphabetizeRule { + /** + * Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more. + * + * @see [alphabetize](https://the-guild.dev/graphql/eslint/rules/alphabetize) + */ + '@graphql-eslint/alphabetize': AlphabetizeRuleConfig; +} diff --git a/src/rules/graphql-eslint/description-style.d.ts b/src/rules/graphql-eslint/description-style.d.ts new file mode 100644 index 00000000..1cd29ec8 --- /dev/null +++ b/src/rules/graphql-eslint/description-style.d.ts @@ -0,0 +1,41 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type DescriptionStyleOption = + | [] + | [ + { + style?: 'block' | 'inline'; + }, + ]; + +/** + * Options. + */ +export type DescriptionStyleOptions = DescriptionStyleOption; + +/** + * Require all comments to follow the same style (either block or inline). + * + * @see [description-style](https://the-guild.dev/graphql/eslint/rules/description-style) + */ +export type DescriptionStyleRuleConfig = RuleConfig; + +/** + * Require all comments to follow the same style (either block or inline). + * + * @see [description-style](https://the-guild.dev/graphql/eslint/rules/description-style) + */ +export interface DescriptionStyleRule { + /** + * Require all comments to follow the same style (either block or inline). + * + * @see [description-style](https://the-guild.dev/graphql/eslint/rules/description-style) + */ + '@graphql-eslint/description-style': DescriptionStyleRuleConfig; +} diff --git a/src/rules/graphql-eslint/executable-definitions.d.ts b/src/rules/graphql-eslint/executable-definitions.d.ts new file mode 100644 index 00000000..d66b2fce --- /dev/null +++ b/src/rules/graphql-eslint/executable-definitions.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [executable-definitions](https://the-guild.dev/graphql/eslint/rules/executable-definitions) + */ +export type ExecutableDefinitionsRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [executable-definitions](https://the-guild.dev/graphql/eslint/rules/executable-definitions) + */ +export interface ExecutableDefinitionsRule { + /** + * A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [executable-definitions](https://the-guild.dev/graphql/eslint/rules/executable-definitions) + */ + '@graphql-eslint/executable-definitions': ExecutableDefinitionsRuleConfig; +} diff --git a/src/rules/graphql-eslint/fields-on-correct-type.d.ts b/src/rules/graphql-eslint/fields-on-correct-type.d.ts new file mode 100644 index 00000000..bc22d1fc --- /dev/null +++ b/src/rules/graphql-eslint/fields-on-correct-type.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fields-on-correct-type](https://the-guild.dev/graphql/eslint/rules/fields-on-correct-type) + */ +export type FieldsOnCorrectTypeRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fields-on-correct-type](https://the-guild.dev/graphql/eslint/rules/fields-on-correct-type) + */ +export interface FieldsOnCorrectTypeRule { + /** + * A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fields-on-correct-type](https://the-guild.dev/graphql/eslint/rules/fields-on-correct-type) + */ + '@graphql-eslint/fields-on-correct-type': FieldsOnCorrectTypeRuleConfig; +} diff --git a/src/rules/graphql-eslint/fragments-on-composite-type.d.ts b/src/rules/graphql-eslint/fragments-on-composite-type.d.ts new file mode 100644 index 00000000..c20be261 --- /dev/null +++ b/src/rules/graphql-eslint/fragments-on-composite-type.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fragments-on-composite-type](https://the-guild.dev/graphql/eslint/rules/fragments-on-composite-type) + */ +export type FragmentsOnCompositeTypeRuleConfig = RuleConfig<[]>; + +/** + * Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fragments-on-composite-type](https://the-guild.dev/graphql/eslint/rules/fragments-on-composite-type) + */ +export interface FragmentsOnCompositeTypeRule { + /** + * Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [fragments-on-composite-type](https://the-guild.dev/graphql/eslint/rules/fragments-on-composite-type) + */ + '@graphql-eslint/fragments-on-composite-type': FragmentsOnCompositeTypeRuleConfig; +} diff --git a/src/rules/graphql-eslint/index.d.ts b/src/rules/graphql-eslint/index.d.ts new file mode 100644 index 00000000..309d12d3 --- /dev/null +++ b/src/rules/graphql-eslint/index.d.ts @@ -0,0 +1,130 @@ +import type { AlphabetizeRule } from './alphabetize'; +import type { DescriptionStyleRule } from './description-style'; +import type { ExecutableDefinitionsRule } from './executable-definitions'; +import type { FieldsOnCorrectTypeRule } from './fields-on-correct-type'; +import type { FragmentsOnCompositeTypeRule } from './fragments-on-composite-type'; +import type { InputNameRule } from './input-name'; +import type { KnownArgumentNamesRule } from './known-argument-names'; +import type { KnownDirectivesRule } from './known-directives'; +import type { KnownFragmentNamesRule } from './known-fragment-names'; +import type { KnownTypeNamesRule } from './known-type-names'; +import type { LoneAnonymousOperationRule } from './lone-anonymous-operation'; +import type { LoneExecutableDefinitionRule } from './lone-executable-definition'; +import type { LoneSchemaDefinitionRule } from './lone-schema-definition'; +import type { MatchDocumentFilenameRule } from './match-document-filename'; +import type { NamingConventionRule } from './naming-convention'; +import type { NoAnonymousOperationsRule } from './no-anonymous-operations'; +import type { NoCaseInsensitiveEnumValuesDuplicatesRule } from './no-case-insensitive-enum-values-duplicates'; +import type { NoDeprecatedRule } from './no-deprecated'; +import type { NoDuplicateFieldsRule } from './no-duplicate-fields'; +import type { NoFragmentCyclesRule } from './no-fragment-cycles'; +import type { NoHashtagDescriptionRule } from './no-hashtag-description'; +import type { NoOnePlaceFragmentsRule } from './no-one-place-fragments'; +import type { NoRootTypeRule } from './no-root-type'; +import type { NoScalarResultTypeOnMutationRule } from './no-scalar-result-type-on-mutation'; +import type { NoTypenamePrefixRule } from './no-typename-prefix'; +import type { NoUndefinedVariablesRule } from './no-undefined-variables'; +import type { NoUnreachableTypesRule } from './no-unreachable-types'; +import type { NoUnusedFieldsRule } from './no-unused-fields'; +import type { NoUnusedFragmentsRule } from './no-unused-fragments'; +import type { NoUnusedVariablesRule } from './no-unused-variables'; +import type { OneFieldSubscriptionsRule } from './one-field-subscriptions'; +import type { OverlappingFieldsCanBeMergedRule } from './overlapping-fields-can-be-merged'; +import type { PossibleFragmentSpreadRule } from './possible-fragment-spread'; +import type { PossibleTypeExtensionRule } from './possible-type-extension'; +import type { ProvidedRequiredArgumentsRule } from './provided-required-arguments'; +import type { RelayArgumentsRule } from './relay-arguments'; +import type { RelayConnectionTypesRule } from './relay-connection-types'; +import type { RelayEdgeTypesRule } from './relay-edge-types'; +import type { RelayPageInfoRule } from './relay-page-info'; +import type { RequireDeprecationDateRule } from './require-deprecation-date'; +import type { RequireDeprecationReasonRule } from './require-deprecation-reason'; +import type { RequireDescriptionRule } from './require-description'; +import type { RequireFieldOfTypeQueryInMutationResultRule } from './require-field-of-type-query-in-mutation-result'; +import type { RequireIdWhenAvailableRule } from './require-id-when-available'; +import type { RequireNullableFieldsWithOneofRule } from './require-nullable-fields-with-oneof'; +import type { RequireTypePatternWithOneofRule } from './require-type-pattern-with-oneof'; +import type { ScalarLeafsRule } from './scalar-leafs'; +import type { SelectionSetDepthRule } from './selection-set-depth'; +import type { StrictIdInTypesRule } from './strict-id-in-types'; +import type { UniqueArgumentNamesRule } from './unique-argument-names'; +import type { UniqueDirectiveNamesRule } from './unique-directive-names'; +import type { UniqueDirectiveNamesPerLocationRule } from './unique-directive-names-per-location'; +import type { UniqueEnumValueNamesRule } from './unique-enum-value-names'; +import type { UniqueFieldDefinitionNamesRule } from './unique-field-definition-names'; +import type { UniqueFragmentNameRule } from './unique-fragment-name'; +import type { UniqueInputFieldNamesRule } from './unique-input-field-names'; +import type { UniqueOperationNameRule } from './unique-operation-name'; +import type { UniqueOperationTypesRule } from './unique-operation-types'; +import type { UniqueTypeNamesRule } from './unique-type-names'; +import type { UniqueVariableNamesRule } from './unique-variable-names'; +import type { ValueLiteralsOfCorrectTypeRule } from './value-literals-of-correct-type'; +import type { VariablesAreInputTypesRule } from './variables-are-input-types'; +import type { VariablesInAllowedPositionRule } from './variables-in-allowed-position'; + +/** + * All GraphQL rules. + */ +export type GraphQLRules = ExecutableDefinitionsRule & + FieldsOnCorrectTypeRule & + FragmentsOnCompositeTypeRule & + KnownArgumentNamesRule & + KnownDirectivesRule & + KnownFragmentNamesRule & + KnownTypeNamesRule & + LoneAnonymousOperationRule & + LoneSchemaDefinitionRule & + NoFragmentCyclesRule & + NoUndefinedVariablesRule & + NoUnusedFragmentsRule & + NoUnusedVariablesRule & + OverlappingFieldsCanBeMergedRule & + PossibleFragmentSpreadRule & + PossibleTypeExtensionRule & + ProvidedRequiredArgumentsRule & + ScalarLeafsRule & + OneFieldSubscriptionsRule & + UniqueArgumentNamesRule & + UniqueDirectiveNamesRule & + UniqueDirectiveNamesPerLocationRule & + UniqueEnumValueNamesRule & + UniqueFieldDefinitionNamesRule & + UniqueInputFieldNamesRule & + UniqueOperationTypesRule & + UniqueTypeNamesRule & + UniqueVariableNamesRule & + ValueLiteralsOfCorrectTypeRule & + VariablesAreInputTypesRule & + VariablesInAllowedPositionRule & + AlphabetizeRule & + DescriptionStyleRule & + InputNameRule & + LoneExecutableDefinitionRule & + MatchDocumentFilenameRule & + NamingConventionRule & + NoAnonymousOperationsRule & + NoCaseInsensitiveEnumValuesDuplicatesRule & + NoDeprecatedRule & + NoDuplicateFieldsRule & + NoHashtagDescriptionRule & + NoOnePlaceFragmentsRule & + NoRootTypeRule & + NoScalarResultTypeOnMutationRule & + NoTypenamePrefixRule & + NoUnreachableTypesRule & + NoUnusedFieldsRule & + RelayArgumentsRule & + RelayConnectionTypesRule & + RelayEdgeTypesRule & + RelayPageInfoRule & + RequireDeprecationDateRule & + RequireDeprecationReasonRule & + RequireDescriptionRule & + RequireFieldOfTypeQueryInMutationResultRule & + RequireIdWhenAvailableRule & + RequireNullableFieldsWithOneofRule & + RequireTypePatternWithOneofRule & + SelectionSetDepthRule & + StrictIdInTypesRule & + UniqueFragmentNameRule & + UniqueOperationNameRule; diff --git a/src/rules/graphql-eslint/input-name.d.ts b/src/rules/graphql-eslint/input-name.d.ts new file mode 100644 index 00000000..785d5fd1 --- /dev/null +++ b/src/rules/graphql-eslint/input-name.d.ts @@ -0,0 +1,59 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type InputNameOption = + | [] + | [ + { + /** + * Check that the input type name follows the convention \Input + */ + checkInputType?: boolean; + /** + * Allow for case discrepancies in the input type name + */ + caseSensitiveInputType?: boolean; + /** + * Apply the rule to Queries + */ + checkQueries?: boolean; + /** + * Apply the rule to Mutations + */ + checkMutations?: boolean; + }, + ]; + +/** + * Options. + */ +export type InputNameOptions = InputNameOption; + +/** + * Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". +Using the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to. + * + * @see [input-name](https://the-guild.dev/graphql/eslint/rules/input-name) + */ +export type InputNameRuleConfig = RuleConfig; + +/** + * Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". +Using the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to. + * + * @see [input-name](https://the-guild.dev/graphql/eslint/rules/input-name) + */ +export interface InputNameRule { + /** + * Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". +Using the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to. + * + * @see [input-name](https://the-guild.dev/graphql/eslint/rules/input-name) + */ + '@graphql-eslint/input-name': InputNameRuleConfig; +} diff --git a/src/rules/graphql-eslint/known-argument-names.d.ts b/src/rules/graphql-eslint/known-argument-names.d.ts new file mode 100644 index 00000000..4fad5539 --- /dev/null +++ b/src/rules/graphql-eslint/known-argument-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL field is only valid if all supplied arguments are defined by that field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-argument-names](https://the-guild.dev/graphql/eslint/rules/known-argument-names) + */ +export type KnownArgumentNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL field is only valid if all supplied arguments are defined by that field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-argument-names](https://the-guild.dev/graphql/eslint/rules/known-argument-names) + */ +export interface KnownArgumentNamesRule { + /** + * A GraphQL field is only valid if all supplied arguments are defined by that field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-argument-names](https://the-guild.dev/graphql/eslint/rules/known-argument-names) + */ + '@graphql-eslint/known-argument-names': KnownArgumentNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/known-directives.d.ts b/src/rules/graphql-eslint/known-directives.d.ts new file mode 100644 index 00000000..808b9034 --- /dev/null +++ b/src/rules/graphql-eslint/known-directives.d.ts @@ -0,0 +1,47 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type KnownDirectivesOption = + | [] + | [ + { + /** + * @minItems 1 + */ + ignoreClientDirectives: [string, ...string[]]; + }, + ]; + +/** + * Options. + */ +export type KnownDirectivesOptions = KnownDirectivesOption; + +/** + * A GraphQL document is only valid if all `@directive`s are known by the schema and legally positioned. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-directives](https://the-guild.dev/graphql/eslint/rules/known-directives) + */ +export type KnownDirectivesRuleConfig = RuleConfig; + +/** + * A GraphQL document is only valid if all `@directive`s are known by the schema and legally positioned. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-directives](https://the-guild.dev/graphql/eslint/rules/known-directives) + */ +export interface KnownDirectivesRule { + /** + * A GraphQL document is only valid if all `@directive`s are known by the schema and legally positioned. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-directives](https://the-guild.dev/graphql/eslint/rules/known-directives) + */ + '@graphql-eslint/known-directives': KnownDirectivesRuleConfig; +} diff --git a/src/rules/graphql-eslint/known-fragment-names.d.ts b/src/rules/graphql-eslint/known-fragment-names.d.ts new file mode 100644 index 00000000..5a1ab7c6 --- /dev/null +++ b/src/rules/graphql-eslint/known-fragment-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-fragment-names](https://the-guild.dev/graphql/eslint/rules/known-fragment-names) + */ +export type KnownFragmentNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-fragment-names](https://the-guild.dev/graphql/eslint/rules/known-fragment-names) + */ +export interface KnownFragmentNamesRule { + /** + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-fragment-names](https://the-guild.dev/graphql/eslint/rules/known-fragment-names) + */ + '@graphql-eslint/known-fragment-names': KnownFragmentNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/known-type-names.d.ts b/src/rules/graphql-eslint/known-type-names.d.ts new file mode 100644 index 00000000..213524a9 --- /dev/null +++ b/src/rules/graphql-eslint/known-type-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-type-names](https://the-guild.dev/graphql/eslint/rules/known-type-names) + */ +export type KnownTypeNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-type-names](https://the-guild.dev/graphql/eslint/rules/known-type-names) + */ +export interface KnownTypeNamesRule { + /** + * A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [known-type-names](https://the-guild.dev/graphql/eslint/rules/known-type-names) + */ + '@graphql-eslint/known-type-names': KnownTypeNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/lone-anonymous-operation.d.ts b/src/rules/graphql-eslint/lone-anonymous-operation.d.ts new file mode 100644 index 00000000..d38cf9fd --- /dev/null +++ b/src/rules/graphql-eslint/lone-anonymous-operation.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document that contains an anonymous operation (the `query` short-hand) is only valid if it contains only that one operation definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-anonymous-operation](https://the-guild.dev/graphql/eslint/rules/lone-anonymous-operation) + */ +export type LoneAnonymousOperationRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document that contains an anonymous operation (the `query` short-hand) is only valid if it contains only that one operation definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-anonymous-operation](https://the-guild.dev/graphql/eslint/rules/lone-anonymous-operation) + */ +export interface LoneAnonymousOperationRule { + /** + * A GraphQL document that contains an anonymous operation (the `query` short-hand) is only valid if it contains only that one operation definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-anonymous-operation](https://the-guild.dev/graphql/eslint/rules/lone-anonymous-operation) + */ + '@graphql-eslint/lone-anonymous-operation': LoneAnonymousOperationRuleConfig; +} diff --git a/src/rules/graphql-eslint/lone-executable-definition.d.ts b/src/rules/graphql-eslint/lone-executable-definition.d.ts new file mode 100644 index 00000000..eace494d --- /dev/null +++ b/src/rules/graphql-eslint/lone-executable-definition.d.ts @@ -0,0 +1,58 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type LoneExecutableDefinitionOption = + | [] + | [ + { + /** + * Allow certain definitions to be placed alongside others. + * + * @minItems 1 + * @maxItems 3 + */ + ignore?: + | ['fragment' | 'query' | 'mutation' | 'subscription'] + | [ + 'fragment' | 'query' | 'mutation' | 'subscription', + 'fragment' | 'query' | 'mutation' | 'subscription', + ] + | [ + 'fragment' | 'query' | 'mutation' | 'subscription', + 'fragment' | 'query' | 'mutation' | 'subscription', + 'fragment' | 'query' | 'mutation' | 'subscription', + ]; + }, + ]; + +/** + * Options. + */ +export type LoneExecutableDefinitionOptions = LoneExecutableDefinitionOption; + +/** + * Require queries, mutations, subscriptions or fragments to be located in separate files. + * + * @see [lone-executable-definition](https://the-guild.dev/graphql/eslint/rules/lone-executable-definition) + */ +export type LoneExecutableDefinitionRuleConfig = + RuleConfig; + +/** + * Require queries, mutations, subscriptions or fragments to be located in separate files. + * + * @see [lone-executable-definition](https://the-guild.dev/graphql/eslint/rules/lone-executable-definition) + */ +export interface LoneExecutableDefinitionRule { + /** + * Require queries, mutations, subscriptions or fragments to be located in separate files. + * + * @see [lone-executable-definition](https://the-guild.dev/graphql/eslint/rules/lone-executable-definition) + */ + '@graphql-eslint/lone-executable-definition': LoneExecutableDefinitionRuleConfig; +} diff --git a/src/rules/graphql-eslint/lone-schema-definition.d.ts b/src/rules/graphql-eslint/lone-schema-definition.d.ts new file mode 100644 index 00000000..fc960739 --- /dev/null +++ b/src/rules/graphql-eslint/lone-schema-definition.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if it contains only one schema definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-schema-definition](https://the-guild.dev/graphql/eslint/rules/lone-schema-definition) + */ +export type LoneSchemaDefinitionRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if it contains only one schema definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-schema-definition](https://the-guild.dev/graphql/eslint/rules/lone-schema-definition) + */ +export interface LoneSchemaDefinitionRule { + /** + * A GraphQL document is only valid if it contains only one schema definition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [lone-schema-definition](https://the-guild.dev/graphql/eslint/rules/lone-schema-definition) + */ + '@graphql-eslint/lone-schema-definition': LoneSchemaDefinitionRuleConfig; +} diff --git a/src/rules/graphql-eslint/match-document-filename.d.ts b/src/rules/graphql-eslint/match-document-filename.d.ts new file mode 100644 index 00000000..b2539a92 --- /dev/null +++ b/src/rules/graphql-eslint/match-document-filename.d.ts @@ -0,0 +1,67 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + * @maxItems 1 + */ +export type MatchDocumentFilenameOption = [ + { + fileExtension?: '.gql' | '.graphql'; + query?: AsString | AsObject; + mutation?: AsString | AsObject; + subscription?: AsString | AsObject; + fragment?: AsString | AsObject; + }, +]; +/** + * One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE`, `kebab-case`, `matchDocumentStyle` + */ +export type AsString = + | 'camelCase' + | 'PascalCase' + | 'snake_case' + | 'UPPER_CASE' + | 'kebab-case' + | 'matchDocumentStyle'; + +export interface AsObject { + style?: + | 'camelCase' + | 'PascalCase' + | 'snake_case' + | 'UPPER_CASE' + | 'kebab-case' + | 'matchDocumentStyle'; + suffix?: string; + prefix?: string; +} + +/** + * Options. + */ +export type MatchDocumentFilenameOptions = MatchDocumentFilenameOption; + +/** + * This rule allows you to enforce that the file name should match the operation name. + * + * @see [match-document-filename](https://the-guild.dev/graphql/eslint/rules/match-document-filename) + */ +export type MatchDocumentFilenameRuleConfig = + RuleConfig; + +/** + * This rule allows you to enforce that the file name should match the operation name. + * + * @see [match-document-filename](https://the-guild.dev/graphql/eslint/rules/match-document-filename) + */ +export interface MatchDocumentFilenameRule { + /** + * This rule allows you to enforce that the file name should match the operation name. + * + * @see [match-document-filename](https://the-guild.dev/graphql/eslint/rules/match-document-filename) + */ + '@graphql-eslint/match-document-filename': MatchDocumentFilenameRuleConfig; +} diff --git a/src/rules/graphql-eslint/naming-convention.d.ts b/src/rules/graphql-eslint/naming-convention.d.ts new file mode 100644 index 00000000..5ca7469a --- /dev/null +++ b/src/rules/graphql-eslint/naming-convention.d.ts @@ -0,0 +1,130 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type NamingConventionOption = + | [] + | [ + { + /** + * Includes: + * - `ObjectTypeDefinition` + * - `InterfaceTypeDefinition` + * - `EnumTypeDefinition` + * - `ScalarTypeDefinition` + * - `InputObjectTypeDefinition` + * - `UnionTypeDefinition` + */ + types?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#Argument). + */ + Argument?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#DirectiveDefinition). + */ + DirectiveDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumTypeDefinition). + */ + EnumTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumValueDefinition). + */ + EnumValueDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FieldDefinition). + */ + FieldDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FragmentDefinition). + */ + FragmentDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputObjectTypeDefinition). + */ + InputObjectTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputValueDefinition). + */ + InputValueDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InterfaceTypeDefinition). + */ + InterfaceTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ObjectTypeDefinition). + */ + ObjectTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#OperationDefinition). + */ + OperationDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ScalarTypeDefinition). + */ + ScalarTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#UnionTypeDefinition). + */ + UnionTypeDefinition?: AsString | AsObject; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#VariableDefinition). + */ + VariableDefinition?: AsString | AsObject; + allowLeadingUnderscore?: boolean; + allowTrailingUnderscore?: boolean; + }, + ]; +/** + * One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE` + */ +export type AsString = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE'; + +export interface AsObject { + style?: 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE'; + prefix?: string; + suffix?: string; + /** + * @minItems 1 + */ + forbiddenPrefixes?: [string, ...string[]]; + /** + * @minItems 1 + */ + forbiddenSuffixes?: [string, ...string[]]; + /** + * Option to skip validation of some words, e.g. acronyms + */ + ignorePattern?: string; +} + +/** + * Options. + */ +export type NamingConventionOptions = NamingConventionOption; + +/** + * Require names to follow specified conventions. + * + * @see [naming-convention](https://the-guild.dev/graphql/eslint/rules/naming-convention) + */ +export type NamingConventionRuleConfig = RuleConfig; + +/** + * Require names to follow specified conventions. + * + * @see [naming-convention](https://the-guild.dev/graphql/eslint/rules/naming-convention) + */ +export interface NamingConventionRule { + /** + * Require names to follow specified conventions. + * + * @see [naming-convention](https://the-guild.dev/graphql/eslint/rules/naming-convention) + */ + '@graphql-eslint/naming-convention': NamingConventionRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-anonymous-operations.d.ts b/src/rules/graphql-eslint/no-anonymous-operations.d.ts new file mode 100644 index 00000000..510095df --- /dev/null +++ b/src/rules/graphql-eslint/no-anonymous-operations.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes. + * + * @see [no-anonymous-operations](https://the-guild.dev/graphql/eslint/rules/no-anonymous-operations) + */ +export type NoAnonymousOperationsRuleConfig = RuleConfig<[]>; + +/** + * Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes. + * + * @see [no-anonymous-operations](https://the-guild.dev/graphql/eslint/rules/no-anonymous-operations) + */ +export interface NoAnonymousOperationsRule { + /** + * Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes. + * + * @see [no-anonymous-operations](https://the-guild.dev/graphql/eslint/rules/no-anonymous-operations) + */ + '@graphql-eslint/no-anonymous-operations': NoAnonymousOperationsRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-case-insensitive-enum-values-duplicates.d.ts b/src/rules/graphql-eslint/no-case-insensitive-enum-values-duplicates.d.ts new file mode 100644 index 00000000..68f990cd --- /dev/null +++ b/src/rules/graphql-eslint/no-case-insensitive-enum-values-duplicates.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow case-insensitive enum values duplicates. + * + * @see [no-case-insensitive-enum-values-duplicates](https://the-guild.dev/graphql/eslint/rules/no-case-insensitive-enum-values-duplicates) + */ +export type NoCaseInsensitiveEnumValuesDuplicatesRuleConfig = RuleConfig<[]>; + +/** + * Disallow case-insensitive enum values duplicates. + * + * @see [no-case-insensitive-enum-values-duplicates](https://the-guild.dev/graphql/eslint/rules/no-case-insensitive-enum-values-duplicates) + */ +export interface NoCaseInsensitiveEnumValuesDuplicatesRule { + /** + * Disallow case-insensitive enum values duplicates. + * + * @see [no-case-insensitive-enum-values-duplicates](https://the-guild.dev/graphql/eslint/rules/no-case-insensitive-enum-values-duplicates) + */ + '@graphql-eslint/no-case-insensitive-enum-values-duplicates': NoCaseInsensitiveEnumValuesDuplicatesRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-deprecated.d.ts b/src/rules/graphql-eslint/no-deprecated.d.ts new file mode 100644 index 00000000..7da258ad --- /dev/null +++ b/src/rules/graphql-eslint/no-deprecated.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Enforce that deprecated fields or enum values are not in use by operations. + * + * @see [no-deprecated](https://the-guild.dev/graphql/eslint/rules/no-deprecated) + */ +export type NoDeprecatedRuleConfig = RuleConfig<[]>; + +/** + * Enforce that deprecated fields or enum values are not in use by operations. + * + * @see [no-deprecated](https://the-guild.dev/graphql/eslint/rules/no-deprecated) + */ +export interface NoDeprecatedRule { + /** + * Enforce that deprecated fields or enum values are not in use by operations. + * + * @see [no-deprecated](https://the-guild.dev/graphql/eslint/rules/no-deprecated) + */ + '@graphql-eslint/no-deprecated': NoDeprecatedRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-duplicate-fields.d.ts b/src/rules/graphql-eslint/no-duplicate-fields.d.ts new file mode 100644 index 00000000..20caaad7 --- /dev/null +++ b/src/rules/graphql-eslint/no-duplicate-fields.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field. + * + * @see [no-duplicate-fields](https://the-guild.dev/graphql/eslint/rules/no-duplicate-fields) + */ +export type NoDuplicateFieldsRuleConfig = RuleConfig<[]>; + +/** + * Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field. + * + * @see [no-duplicate-fields](https://the-guild.dev/graphql/eslint/rules/no-duplicate-fields) + */ +export interface NoDuplicateFieldsRule { + /** + * Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field. + * + * @see [no-duplicate-fields](https://the-guild.dev/graphql/eslint/rules/no-duplicate-fields) + */ + '@graphql-eslint/no-duplicate-fields': NoDuplicateFieldsRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-fragment-cycles.d.ts b/src/rules/graphql-eslint/no-fragment-cycles.d.ts new file mode 100644 index 00000000..a701e250 --- /dev/null +++ b/src/rules/graphql-eslint/no-fragment-cycles.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL fragment is only valid when it does not have cycles in fragments usage. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-fragment-cycles](https://the-guild.dev/graphql/eslint/rules/no-fragment-cycles) + */ +export type NoFragmentCyclesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL fragment is only valid when it does not have cycles in fragments usage. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-fragment-cycles](https://the-guild.dev/graphql/eslint/rules/no-fragment-cycles) + */ +export interface NoFragmentCyclesRule { + /** + * A GraphQL fragment is only valid when it does not have cycles in fragments usage. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-fragment-cycles](https://the-guild.dev/graphql/eslint/rules/no-fragment-cycles) + */ + '@graphql-eslint/no-fragment-cycles': NoFragmentCyclesRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-hashtag-description.d.ts b/src/rules/graphql-eslint/no-hashtag-description.d.ts new file mode 100644 index 00000000..121e5bb5 --- /dev/null +++ b/src/rules/graphql-eslint/no-hashtag-description.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Requires to use `"""` or `"` for adding a GraphQL description instead of `#`. +Allows to use hashtag for comments, as long as it's not attached to an AST definition. + * + * @see [no-hashtag-description](https://the-guild.dev/graphql/eslint/rules/no-hashtag-description) + */ +export type NoHashtagDescriptionRuleConfig = RuleConfig<[]>; + +/** + * Requires to use `"""` or `"` for adding a GraphQL description instead of `#`. +Allows to use hashtag for comments, as long as it's not attached to an AST definition. + * + * @see [no-hashtag-description](https://the-guild.dev/graphql/eslint/rules/no-hashtag-description) + */ +export interface NoHashtagDescriptionRule { + /** + * Requires to use `"""` or `"` for adding a GraphQL description instead of `#`. +Allows to use hashtag for comments, as long as it's not attached to an AST definition. + * + * @see [no-hashtag-description](https://the-guild.dev/graphql/eslint/rules/no-hashtag-description) + */ + '@graphql-eslint/no-hashtag-description': NoHashtagDescriptionRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-one-place-fragments.d.ts b/src/rules/graphql-eslint/no-one-place-fragments.d.ts new file mode 100644 index 00000000..e389d7d3 --- /dev/null +++ b/src/rules/graphql-eslint/no-one-place-fragments.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow fragments that are used only in one place. + * + * @see [no-one-place-fragments](https://the-guild.dev/graphql/eslint/rules/no-one-place-fragments) + */ +export type NoOnePlaceFragmentsRuleConfig = RuleConfig<[]>; + +/** + * Disallow fragments that are used only in one place. + * + * @see [no-one-place-fragments](https://the-guild.dev/graphql/eslint/rules/no-one-place-fragments) + */ +export interface NoOnePlaceFragmentsRule { + /** + * Disallow fragments that are used only in one place. + * + * @see [no-one-place-fragments](https://the-guild.dev/graphql/eslint/rules/no-one-place-fragments) + */ + '@graphql-eslint/no-one-place-fragments': NoOnePlaceFragmentsRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-root-type.d.ts b/src/rules/graphql-eslint/no-root-type.d.ts new file mode 100644 index 00000000..2f18126b --- /dev/null +++ b/src/rules/graphql-eslint/no-root-type.d.ts @@ -0,0 +1,43 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + * @maxItems 1 + */ +export type NoRootTypeOption = [ + { + /** + * @minItems 1 + */ + disallow: ['mutation' | 'subscription', ...('mutation' | 'subscription')[]]; + }, +]; + +/** + * Options. + */ +export type NoRootTypeOptions = NoRootTypeOption; + +/** + * Disallow using root types `mutation` and/or `subscription`. + * + * @see [no-root-type](https://the-guild.dev/graphql/eslint/rules/no-root-type) + */ +export type NoRootTypeRuleConfig = RuleConfig; + +/** + * Disallow using root types `mutation` and/or `subscription`. + * + * @see [no-root-type](https://the-guild.dev/graphql/eslint/rules/no-root-type) + */ +export interface NoRootTypeRule { + /** + * Disallow using root types `mutation` and/or `subscription`. + * + * @see [no-root-type](https://the-guild.dev/graphql/eslint/rules/no-root-type) + */ + '@graphql-eslint/no-root-type': NoRootTypeRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-scalar-result-type-on-mutation.d.ts b/src/rules/graphql-eslint/no-scalar-result-type-on-mutation.d.ts new file mode 100644 index 00000000..c04df609 --- /dev/null +++ b/src/rules/graphql-eslint/no-scalar-result-type-on-mutation.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Avoid scalar result type on mutation type to make sure to return a valid state. + * + * @see [no-scalar-result-type-on-mutation](https://the-guild.dev/graphql/eslint/rules/no-scalar-result-type-on-mutation) + */ +export type NoScalarResultTypeOnMutationRuleConfig = RuleConfig<[]>; + +/** + * Avoid scalar result type on mutation type to make sure to return a valid state. + * + * @see [no-scalar-result-type-on-mutation](https://the-guild.dev/graphql/eslint/rules/no-scalar-result-type-on-mutation) + */ +export interface NoScalarResultTypeOnMutationRule { + /** + * Avoid scalar result type on mutation type to make sure to return a valid state. + * + * @see [no-scalar-result-type-on-mutation](https://the-guild.dev/graphql/eslint/rules/no-scalar-result-type-on-mutation) + */ + '@graphql-eslint/no-scalar-result-type-on-mutation': NoScalarResultTypeOnMutationRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-typename-prefix.d.ts b/src/rules/graphql-eslint/no-typename-prefix.d.ts new file mode 100644 index 00000000..09a178c9 --- /dev/null +++ b/src/rules/graphql-eslint/no-typename-prefix.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Enforces users to avoid using the type name in a field name while defining your schema. + * + * @see [no-typename-prefix](https://the-guild.dev/graphql/eslint/rules/no-typename-prefix) + */ +export type NoTypenamePrefixRuleConfig = RuleConfig<[]>; + +/** + * Enforces users to avoid using the type name in a field name while defining your schema. + * + * @see [no-typename-prefix](https://the-guild.dev/graphql/eslint/rules/no-typename-prefix) + */ +export interface NoTypenamePrefixRule { + /** + * Enforces users to avoid using the type name in a field name while defining your schema. + * + * @see [no-typename-prefix](https://the-guild.dev/graphql/eslint/rules/no-typename-prefix) + */ + '@graphql-eslint/no-typename-prefix': NoTypenamePrefixRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-undefined-variables.d.ts b/src/rules/graphql-eslint/no-undefined-variables.d.ts new file mode 100644 index 00000000..d44aa710 --- /dev/null +++ b/src/rules/graphql-eslint/no-undefined-variables.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-undefined-variables](https://the-guild.dev/graphql/eslint/rules/no-undefined-variables) + */ +export type NoUndefinedVariablesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-undefined-variables](https://the-guild.dev/graphql/eslint/rules/no-undefined-variables) + */ +export interface NoUndefinedVariablesRule { + /** + * A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-undefined-variables](https://the-guild.dev/graphql/eslint/rules/no-undefined-variables) + */ + '@graphql-eslint/no-undefined-variables': NoUndefinedVariablesRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-unreachable-types.d.ts b/src/rules/graphql-eslint/no-unreachable-types.d.ts new file mode 100644 index 00000000..ad80a377 --- /dev/null +++ b/src/rules/graphql-eslint/no-unreachable-types.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Requires all types to be reachable at some level by root level fields. + * + * @see [no-unreachable-types](https://the-guild.dev/graphql/eslint/rules/no-unreachable-types) + */ +export type NoUnreachableTypesRuleConfig = RuleConfig<[]>; + +/** + * Requires all types to be reachable at some level by root level fields. + * + * @see [no-unreachable-types](https://the-guild.dev/graphql/eslint/rules/no-unreachable-types) + */ +export interface NoUnreachableTypesRule { + /** + * Requires all types to be reachable at some level by root level fields. + * + * @see [no-unreachable-types](https://the-guild.dev/graphql/eslint/rules/no-unreachable-types) + */ + '@graphql-eslint/no-unreachable-types': NoUnreachableTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-unused-fields.d.ts b/src/rules/graphql-eslint/no-unused-fields.d.ts new file mode 100644 index 00000000..11c3f894 --- /dev/null +++ b/src/rules/graphql-eslint/no-unused-fields.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Requires all fields to be used at some level by siblings operations. + * + * @see [no-unused-fields](https://the-guild.dev/graphql/eslint/rules/no-unused-fields) + */ +export type NoUnusedFieldsRuleConfig = RuleConfig<[]>; + +/** + * Requires all fields to be used at some level by siblings operations. + * + * @see [no-unused-fields](https://the-guild.dev/graphql/eslint/rules/no-unused-fields) + */ +export interface NoUnusedFieldsRule { + /** + * Requires all fields to be used at some level by siblings operations. + * + * @see [no-unused-fields](https://the-guild.dev/graphql/eslint/rules/no-unused-fields) + */ + '@graphql-eslint/no-unused-fields': NoUnusedFieldsRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-unused-fragments.d.ts b/src/rules/graphql-eslint/no-unused-fragments.d.ts new file mode 100644 index 00000000..fa592331 --- /dev/null +++ b/src/rules/graphql-eslint/no-unused-fragments.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-fragments](https://the-guild.dev/graphql/eslint/rules/no-unused-fragments) + */ +export type NoUnusedFragmentsRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-fragments](https://the-guild.dev/graphql/eslint/rules/no-unused-fragments) + */ +export interface NoUnusedFragmentsRule { + /** + * A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-fragments](https://the-guild.dev/graphql/eslint/rules/no-unused-fragments) + */ + '@graphql-eslint/no-unused-fragments': NoUnusedFragmentsRuleConfig; +} diff --git a/src/rules/graphql-eslint/no-unused-variables.d.ts b/src/rules/graphql-eslint/no-unused-variables.d.ts new file mode 100644 index 00000000..62e1c3e7 --- /dev/null +++ b/src/rules/graphql-eslint/no-unused-variables.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-variables](https://the-guild.dev/graphql/eslint/rules/no-unused-variables) + */ +export type NoUnusedVariablesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-variables](https://the-guild.dev/graphql/eslint/rules/no-unused-variables) + */ +export interface NoUnusedVariablesRule { + /** + * A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [no-unused-variables](https://the-guild.dev/graphql/eslint/rules/no-unused-variables) + */ + '@graphql-eslint/no-unused-variables': NoUnusedVariablesRuleConfig; +} diff --git a/src/rules/graphql-eslint/one-field-subscriptions.d.ts b/src/rules/graphql-eslint/one-field-subscriptions.d.ts new file mode 100644 index 00000000..5b507269 --- /dev/null +++ b/src/rules/graphql-eslint/one-field-subscriptions.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL subscription is valid only if it contains a single root field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [one-field-subscriptions](https://the-guild.dev/graphql/eslint/rules/one-field-subscriptions) + */ +export type OneFieldSubscriptionsRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL subscription is valid only if it contains a single root field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [one-field-subscriptions](https://the-guild.dev/graphql/eslint/rules/one-field-subscriptions) + */ +export interface OneFieldSubscriptionsRule { + /** + * A GraphQL subscription is valid only if it contains a single root field. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [one-field-subscriptions](https://the-guild.dev/graphql/eslint/rules/one-field-subscriptions) + */ + '@graphql-eslint/one-field-subscriptions': OneFieldSubscriptionsRuleConfig; +} diff --git a/src/rules/graphql-eslint/overlapping-fields-can-be-merged.d.ts b/src/rules/graphql-eslint/overlapping-fields-can-be-merged.d.ts new file mode 100644 index 00000000..05abdadc --- /dev/null +++ b/src/rules/graphql-eslint/overlapping-fields-can-be-merged.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [overlapping-fields-can-be-merged](https://the-guild.dev/graphql/eslint/rules/overlapping-fields-can-be-merged) + */ +export type OverlappingFieldsCanBeMergedRuleConfig = RuleConfig<[]>; + +/** + * A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [overlapping-fields-can-be-merged](https://the-guild.dev/graphql/eslint/rules/overlapping-fields-can-be-merged) + */ +export interface OverlappingFieldsCanBeMergedRule { + /** + * A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [overlapping-fields-can-be-merged](https://the-guild.dev/graphql/eslint/rules/overlapping-fields-can-be-merged) + */ + '@graphql-eslint/overlapping-fields-can-be-merged': OverlappingFieldsCanBeMergedRuleConfig; +} diff --git a/src/rules/graphql-eslint/possible-fragment-spread.d.ts b/src/rules/graphql-eslint/possible-fragment-spread.d.ts new file mode 100644 index 00000000..f04a86c0 --- /dev/null +++ b/src/rules/graphql-eslint/possible-fragment-spread.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-fragment-spread](https://the-guild.dev/graphql/eslint/rules/possible-fragment-spread) + */ +export type PossibleFragmentSpreadRuleConfig = RuleConfig<[]>; + +/** + * A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-fragment-spread](https://the-guild.dev/graphql/eslint/rules/possible-fragment-spread) + */ +export interface PossibleFragmentSpreadRule { + /** + * A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-fragment-spread](https://the-guild.dev/graphql/eslint/rules/possible-fragment-spread) + */ + '@graphql-eslint/possible-fragment-spread': PossibleFragmentSpreadRuleConfig; +} diff --git a/src/rules/graphql-eslint/possible-type-extension.d.ts b/src/rules/graphql-eslint/possible-type-extension.d.ts new file mode 100644 index 00000000..371bbc7a --- /dev/null +++ b/src/rules/graphql-eslint/possible-type-extension.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A type extension is only valid if the type is defined and has the same kind. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-type-extension](https://the-guild.dev/graphql/eslint/rules/possible-type-extension) + */ +export type PossibleTypeExtensionRuleConfig = RuleConfig<[]>; + +/** + * A type extension is only valid if the type is defined and has the same kind. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-type-extension](https://the-guild.dev/graphql/eslint/rules/possible-type-extension) + */ +export interface PossibleTypeExtensionRule { + /** + * A type extension is only valid if the type is defined and has the same kind. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [possible-type-extension](https://the-guild.dev/graphql/eslint/rules/possible-type-extension) + */ + '@graphql-eslint/possible-type-extension': PossibleTypeExtensionRuleConfig; +} diff --git a/src/rules/graphql-eslint/provided-required-arguments.d.ts b/src/rules/graphql-eslint/provided-required-arguments.d.ts new file mode 100644 index 00000000..94ccca8a --- /dev/null +++ b/src/rules/graphql-eslint/provided-required-arguments.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A field or directive is only valid if all required (non-null without a default value) field arguments have been provided. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [provided-required-arguments](https://the-guild.dev/graphql/eslint/rules/provided-required-arguments) + */ +export type ProvidedRequiredArgumentsRuleConfig = RuleConfig<[]>; + +/** + * A field or directive is only valid if all required (non-null without a default value) field arguments have been provided. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [provided-required-arguments](https://the-guild.dev/graphql/eslint/rules/provided-required-arguments) + */ +export interface ProvidedRequiredArgumentsRule { + /** + * A field or directive is only valid if all required (non-null without a default value) field arguments have been provided. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [provided-required-arguments](https://the-guild.dev/graphql/eslint/rules/provided-required-arguments) + */ + '@graphql-eslint/provided-required-arguments': ProvidedRequiredArgumentsRuleConfig; +} diff --git a/src/rules/graphql-eslint/relay-arguments.d.ts b/src/rules/graphql-eslint/relay-arguments.d.ts new file mode 100644 index 00000000..b68931d1 --- /dev/null +++ b/src/rules/graphql-eslint/relay-arguments.d.ts @@ -0,0 +1,80 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type RelayArgumentsOption = + | [] + | [ + { + /** + * Enforce including both forward and backward pagination arguments + */ + includeBoth?: boolean; + }, + ]; + +/** + * Options. + */ +export type RelayArgumentsOptions = RelayArgumentsOption; + +/** + * Set of rules to follow Relay specification for Arguments. + +- A field that returns a Connection type must include forward pagination arguments (`first` and `after`), backward pagination arguments (`last` and `before`), or both + +Forward pagination arguments + +- `first` takes a non-negative integer +- `after` takes the Cursor type + +Backward pagination arguments + +- `last` takes a non-negative integer +- `before` takes the Cursor type. + * + * @see [relay-arguments](https://the-guild.dev/graphql/eslint/rules/relay-arguments) + */ +export type RelayArgumentsRuleConfig = RuleConfig; + +/** + * Set of rules to follow Relay specification for Arguments. + +- A field that returns a Connection type must include forward pagination arguments (`first` and `after`), backward pagination arguments (`last` and `before`), or both + +Forward pagination arguments + +- `first` takes a non-negative integer +- `after` takes the Cursor type + +Backward pagination arguments + +- `last` takes a non-negative integer +- `before` takes the Cursor type. + * + * @see [relay-arguments](https://the-guild.dev/graphql/eslint/rules/relay-arguments) + */ +export interface RelayArgumentsRule { + /** + * Set of rules to follow Relay specification for Arguments. + +- A field that returns a Connection type must include forward pagination arguments (`first` and `after`), backward pagination arguments (`last` and `before`), or both + +Forward pagination arguments + +- `first` takes a non-negative integer +- `after` takes the Cursor type + +Backward pagination arguments + +- `last` takes a non-negative integer +- `before` takes the Cursor type. + * + * @see [relay-arguments](https://the-guild.dev/graphql/eslint/rules/relay-arguments) + */ + '@graphql-eslint/relay-arguments': RelayArgumentsRuleConfig; +} diff --git a/src/rules/graphql-eslint/relay-connection-types.d.ts b/src/rules/graphql-eslint/relay-connection-types.d.ts new file mode 100644 index 00000000..f23b92bd --- /dev/null +++ b/src/rules/graphql-eslint/relay-connection-types.d.ts @@ -0,0 +1,37 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Set of rules to follow Relay specification for Connection types. + +- Any type whose name ends in "Connection" is considered by spec to be a `Connection type` +- Connection type must be an Object type +- Connection type must contain a field `edges` that return a list type that wraps an edge type +- Connection type must contain a field `pageInfo` that return a non-null `PageInfo` Object type. + * + * @see [relay-connection-types](https://the-guild.dev/graphql/eslint/rules/relay-connection-types) + */ +export type RelayConnectionTypesRuleConfig = RuleConfig<[]>; + +/** + * Set of rules to follow Relay specification for Connection types. + +- Any type whose name ends in "Connection" is considered by spec to be a `Connection type` +- Connection type must be an Object type +- Connection type must contain a field `edges` that return a list type that wraps an edge type +- Connection type must contain a field `pageInfo` that return a non-null `PageInfo` Object type. + * + * @see [relay-connection-types](https://the-guild.dev/graphql/eslint/rules/relay-connection-types) + */ +export interface RelayConnectionTypesRule { + /** + * Set of rules to follow Relay specification for Connection types. + +- Any type whose name ends in "Connection" is considered by spec to be a `Connection type` +- Connection type must be an Object type +- Connection type must contain a field `edges` that return a list type that wraps an edge type +- Connection type must contain a field `pageInfo` that return a non-null `PageInfo` Object type. + * + * @see [relay-connection-types](https://the-guild.dev/graphql/eslint/rules/relay-connection-types) + */ + '@graphql-eslint/relay-connection-types': RelayConnectionTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/relay-edge-types.d.ts b/src/rules/graphql-eslint/relay-edge-types.d.ts new file mode 100644 index 00000000..a16d451e --- /dev/null +++ b/src/rules/graphql-eslint/relay-edge-types.d.ts @@ -0,0 +1,76 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type RelayEdgeTypesOption = + | [] + | [ + { + /** + * Edge type name must end in "Edge". + */ + withEdgeSuffix?: boolean; + /** + * Edge type's field `node` must implement `Node` interface. + */ + shouldImplementNode?: boolean; + /** + * A list type should only wrap an edge type. + */ + listTypeCanWrapOnlyEdgeType?: boolean; + }, + ]; + +/** + * Options. + */ +export type RelayEdgeTypesOptions = RelayEdgeTypesOption; + +/** + * Set of rules to follow Relay specification for Edge types. + +- A type that is returned in list form by a connection type's `edges` field is considered by this spec to be an Edge type +- Edge type must be an Object type +- Edge type must contain a field `node` that return either Scalar, Enum, Object, Interface, Union, or a non-null wrapper around one of those types. Notably, this field cannot return a list +- Edge type must contain a field `cursor` that return either String, Scalar, or a non-null wrapper around one of those types +- Edge type name must end in "Edge" _(optional)_ +- Edge type's field `node` must implement `Node` interface _(optional)_ +- A list type should only wrap an edge type _(optional)_. + * + * @see [relay-edge-types](https://the-guild.dev/graphql/eslint/rules/relay-edge-types) + */ +export type RelayEdgeTypesRuleConfig = RuleConfig; + +/** + * Set of rules to follow Relay specification for Edge types. + +- A type that is returned in list form by a connection type's `edges` field is considered by this spec to be an Edge type +- Edge type must be an Object type +- Edge type must contain a field `node` that return either Scalar, Enum, Object, Interface, Union, or a non-null wrapper around one of those types. Notably, this field cannot return a list +- Edge type must contain a field `cursor` that return either String, Scalar, or a non-null wrapper around one of those types +- Edge type name must end in "Edge" _(optional)_ +- Edge type's field `node` must implement `Node` interface _(optional)_ +- A list type should only wrap an edge type _(optional)_. + * + * @see [relay-edge-types](https://the-guild.dev/graphql/eslint/rules/relay-edge-types) + */ +export interface RelayEdgeTypesRule { + /** + * Set of rules to follow Relay specification for Edge types. + +- A type that is returned in list form by a connection type's `edges` field is considered by this spec to be an Edge type +- Edge type must be an Object type +- Edge type must contain a field `node` that return either Scalar, Enum, Object, Interface, Union, or a non-null wrapper around one of those types. Notably, this field cannot return a list +- Edge type must contain a field `cursor` that return either String, Scalar, or a non-null wrapper around one of those types +- Edge type name must end in "Edge" _(optional)_ +- Edge type's field `node` must implement `Node` interface _(optional)_ +- A list type should only wrap an edge type _(optional)_. + * + * @see [relay-edge-types](https://the-guild.dev/graphql/eslint/rules/relay-edge-types) + */ + '@graphql-eslint/relay-edge-types': RelayEdgeTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/relay-page-info.d.ts b/src/rules/graphql-eslint/relay-page-info.d.ts new file mode 100644 index 00000000..8119f9b9 --- /dev/null +++ b/src/rules/graphql-eslint/relay-page-info.d.ts @@ -0,0 +1,34 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Set of rules to follow Relay specification for `PageInfo` object. + +- `PageInfo` must be an Object type +- `PageInfo` must contain fields `hasPreviousPage` and `hasNextPage`, that return non-null Boolean +- `PageInfo` must contain fields `startCursor` and `endCursor`, that return either String or Scalar, which can be null if there are no results. + * + * @see [relay-page-info](https://the-guild.dev/graphql/eslint/rules/relay-page-info) + */ +export type RelayPageInfoRuleConfig = RuleConfig<[]>; + +/** + * Set of rules to follow Relay specification for `PageInfo` object. + +- `PageInfo` must be an Object type +- `PageInfo` must contain fields `hasPreviousPage` and `hasNextPage`, that return non-null Boolean +- `PageInfo` must contain fields `startCursor` and `endCursor`, that return either String or Scalar, which can be null if there are no results. + * + * @see [relay-page-info](https://the-guild.dev/graphql/eslint/rules/relay-page-info) + */ +export interface RelayPageInfoRule { + /** + * Set of rules to follow Relay specification for `PageInfo` object. + +- `PageInfo` must be an Object type +- `PageInfo` must contain fields `hasPreviousPage` and `hasNextPage`, that return non-null Boolean +- `PageInfo` must contain fields `startCursor` and `endCursor`, that return either String or Scalar, which can be null if there are no results. + * + * @see [relay-page-info](https://the-guild.dev/graphql/eslint/rules/relay-page-info) + */ + '@graphql-eslint/relay-page-info': RelayPageInfoRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-deprecation-date.d.ts b/src/rules/graphql-eslint/require-deprecation-date.d.ts new file mode 100644 index 00000000..680a5494 --- /dev/null +++ b/src/rules/graphql-eslint/require-deprecation-date.d.ts @@ -0,0 +1,42 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type RequireDeprecationDateOption = + | [] + | [ + { + argumentName?: string; + }, + ]; + +/** + * Options. + */ +export type RequireDeprecationDateOptions = RequireDeprecationDateOption; + +/** + * Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date. + * + * @see [require-deprecation-date](https://the-guild.dev/graphql/eslint/rules/require-deprecation-date) + */ +export type RequireDeprecationDateRuleConfig = + RuleConfig; + +/** + * Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date. + * + * @see [require-deprecation-date](https://the-guild.dev/graphql/eslint/rules/require-deprecation-date) + */ +export interface RequireDeprecationDateRule { + /** + * Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date. + * + * @see [require-deprecation-date](https://the-guild.dev/graphql/eslint/rules/require-deprecation-date) + */ + '@graphql-eslint/require-deprecation-date': RequireDeprecationDateRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-deprecation-reason.d.ts b/src/rules/graphql-eslint/require-deprecation-reason.d.ts new file mode 100644 index 00000000..2b7754a5 --- /dev/null +++ b/src/rules/graphql-eslint/require-deprecation-reason.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Require all deprecation directives to specify a reason. + * + * @see [require-deprecation-reason](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason) + */ +export type RequireDeprecationReasonRuleConfig = RuleConfig<[]>; + +/** + * Require all deprecation directives to specify a reason. + * + * @see [require-deprecation-reason](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason) + */ +export interface RequireDeprecationReasonRule { + /** + * Require all deprecation directives to specify a reason. + * + * @see [require-deprecation-reason](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason) + */ + '@graphql-eslint/require-deprecation-reason': RequireDeprecationReasonRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-description.d.ts b/src/rules/graphql-eslint/require-description.d.ts new file mode 100644 index 00000000..484461a4 --- /dev/null +++ b/src/rules/graphql-eslint/require-description.d.ts @@ -0,0 +1,99 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + * @maxItems 1 + */ +export type RequireDescriptionOption = [ + { + /** + * Includes: + * - `ObjectTypeDefinition` + * - `InterfaceTypeDefinition` + * - `EnumTypeDefinition` + * - `ScalarTypeDefinition` + * - `InputObjectTypeDefinition` + * - `UnionTypeDefinition` + */ + types?: boolean; + /** + * Definitions within `Query`, `Mutation`, and `Subscription` root types. + */ + rootField?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#DirectiveDefinition). + */ + DirectiveDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumTypeDefinition). + */ + EnumTypeDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumValueDefinition). + */ + EnumValueDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FieldDefinition). + */ + FieldDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputObjectTypeDefinition). + */ + InputObjectTypeDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputValueDefinition). + */ + InputValueDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InterfaceTypeDefinition). + */ + InterfaceTypeDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ObjectTypeDefinition). + */ + ObjectTypeDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#OperationDefinition). + * > You must use only comment syntax `#` and not description syntax `"""` or `"`. + */ + OperationDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ScalarTypeDefinition). + */ + ScalarTypeDefinition?: boolean; + /** + * Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#UnionTypeDefinition). + */ + UnionTypeDefinition?: boolean; + }, +]; + +/** + * Options. + */ +export type RequireDescriptionOptions = RequireDescriptionOption; + +/** + * Enforce descriptions in type definitions and operations. + * + * @see [require-description](https://the-guild.dev/graphql/eslint/rules/require-description) + */ +export type RequireDescriptionRuleConfig = + RuleConfig; + +/** + * Enforce descriptions in type definitions and operations. + * + * @see [require-description](https://the-guild.dev/graphql/eslint/rules/require-description) + */ +export interface RequireDescriptionRule { + /** + * Enforce descriptions in type definitions and operations. + * + * @see [require-description](https://the-guild.dev/graphql/eslint/rules/require-description) + */ + '@graphql-eslint/require-description': RequireDescriptionRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-field-of-type-query-in-mutation-result.d.ts b/src/rules/graphql-eslint/require-field-of-type-query-in-mutation-result.d.ts new file mode 100644 index 00000000..0c29c173 --- /dev/null +++ b/src/rules/graphql-eslint/require-field-of-type-query-in-mutation-result.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application. +> Currently, no errors are reported for result type `union`, `interface` and `scalar`. + * + * @see [require-field-of-type-query-in-mutation-result](https://the-guild.dev/graphql/eslint/rules/require-field-of-type-query-in-mutation-result) + */ +export type RequireFieldOfTypeQueryInMutationResultRuleConfig = RuleConfig<[]>; + +/** + * Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application. +> Currently, no errors are reported for result type `union`, `interface` and `scalar`. + * + * @see [require-field-of-type-query-in-mutation-result](https://the-guild.dev/graphql/eslint/rules/require-field-of-type-query-in-mutation-result) + */ +export interface RequireFieldOfTypeQueryInMutationResultRule { + /** + * Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application. +> Currently, no errors are reported for result type `union`, `interface` and `scalar`. + * + * @see [require-field-of-type-query-in-mutation-result](https://the-guild.dev/graphql/eslint/rules/require-field-of-type-query-in-mutation-result) + */ + '@graphql-eslint/require-field-of-type-query-in-mutation-result': RequireFieldOfTypeQueryInMutationResultRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-id-when-available.d.ts b/src/rules/graphql-eslint/require-id-when-available.d.ts new file mode 100644 index 00000000..ea7117ef --- /dev/null +++ b/src/rules/graphql-eslint/require-id-when-available.d.ts @@ -0,0 +1,47 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type RequireIdWhenAvailableOption = + | [] + | [ + { + fieldName?: AsString | AsArray; + }, + ]; +export type AsString = string; +/** + * @minItems 1 + */ +export type AsArray = [string, ...string[]]; + +/** + * Options. + */ +export type RequireIdWhenAvailableOptions = RequireIdWhenAvailableOption; + +/** + * Enforce selecting specific fields when they are available on the GraphQL type. + * + * @see [require-id-when-available](https://the-guild.dev/graphql/eslint/rules/require-id-when-available) + */ +export type RequireIdWhenAvailableRuleConfig = + RuleConfig; + +/** + * Enforce selecting specific fields when they are available on the GraphQL type. + * + * @see [require-id-when-available](https://the-guild.dev/graphql/eslint/rules/require-id-when-available) + */ +export interface RequireIdWhenAvailableRule { + /** + * Enforce selecting specific fields when they are available on the GraphQL type. + * + * @see [require-id-when-available](https://the-guild.dev/graphql/eslint/rules/require-id-when-available) + */ + '@graphql-eslint/require-id-when-available': RequireIdWhenAvailableRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-nullable-fields-with-oneof.d.ts b/src/rules/graphql-eslint/require-nullable-fields-with-oneof.d.ts new file mode 100644 index 00000000..091acd85 --- /dev/null +++ b/src/rules/graphql-eslint/require-nullable-fields-with-oneof.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Require `input` or `type` fields to be non-nullable with `@oneOf` directive. + * + * @see [require-nullable-fields-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-nullable-fields-with-oneof) + */ +export type RequireNullableFieldsWithOneofRuleConfig = RuleConfig<[]>; + +/** + * Require `input` or `type` fields to be non-nullable with `@oneOf` directive. + * + * @see [require-nullable-fields-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-nullable-fields-with-oneof) + */ +export interface RequireNullableFieldsWithOneofRule { + /** + * Require `input` or `type` fields to be non-nullable with `@oneOf` directive. + * + * @see [require-nullable-fields-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-nullable-fields-with-oneof) + */ + '@graphql-eslint/require-nullable-fields-with-oneof': RequireNullableFieldsWithOneofRuleConfig; +} diff --git a/src/rules/graphql-eslint/require-type-pattern-with-oneof.d.ts b/src/rules/graphql-eslint/require-type-pattern-with-oneof.d.ts new file mode 100644 index 00000000..9a4ad58c --- /dev/null +++ b/src/rules/graphql-eslint/require-type-pattern-with-oneof.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Enforce types with `@oneOf` directive have `error` and `ok` fields. + * + * @see [require-type-pattern-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-type-pattern-with-oneof) + */ +export type RequireTypePatternWithOneofRuleConfig = RuleConfig<[]>; + +/** + * Enforce types with `@oneOf` directive have `error` and `ok` fields. + * + * @see [require-type-pattern-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-type-pattern-with-oneof) + */ +export interface RequireTypePatternWithOneofRule { + /** + * Enforce types with `@oneOf` directive have `error` and `ok` fields. + * + * @see [require-type-pattern-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-type-pattern-with-oneof) + */ + '@graphql-eslint/require-type-pattern-with-oneof': RequireTypePatternWithOneofRuleConfig; +} diff --git a/src/rules/graphql-eslint/scalar-leafs.d.ts b/src/rules/graphql-eslint/scalar-leafs.d.ts new file mode 100644 index 00000000..b80f2f68 --- /dev/null +++ b/src/rules/graphql-eslint/scalar-leafs.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [scalar-leafs](https://the-guild.dev/graphql/eslint/rules/scalar-leafs) + */ +export type ScalarLeafsRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [scalar-leafs](https://the-guild.dev/graphql/eslint/rules/scalar-leafs) + */ +export interface ScalarLeafsRule { + /** + * A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [scalar-leafs](https://the-guild.dev/graphql/eslint/rules/scalar-leafs) + */ + '@graphql-eslint/scalar-leafs': ScalarLeafsRuleConfig; +} diff --git a/src/rules/graphql-eslint/selection-set-depth.d.ts b/src/rules/graphql-eslint/selection-set-depth.d.ts new file mode 100644 index 00000000..3530b9ea --- /dev/null +++ b/src/rules/graphql-eslint/selection-set-depth.d.ts @@ -0,0 +1,44 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + * @maxItems 1 + */ +export type SelectionSetDepthOption = [ + { + maxDepth: number; + /** + * @minItems 1 + */ + ignore?: [string, ...string[]]; + }, +]; + +/** + * Options. + */ +export type SelectionSetDepthOptions = SelectionSetDepthOption; + +/** + * Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://npmjs.com/package/graphql-depth-limit). + * + * @see [selection-set-depth](https://the-guild.dev/graphql/eslint/rules/selection-set-depth) + */ +export type SelectionSetDepthRuleConfig = RuleConfig; + +/** + * Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://npmjs.com/package/graphql-depth-limit). + * + * @see [selection-set-depth](https://the-guild.dev/graphql/eslint/rules/selection-set-depth) + */ +export interface SelectionSetDepthRule { + /** + * Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://npmjs.com/package/graphql-depth-limit). + * + * @see [selection-set-depth](https://the-guild.dev/graphql/eslint/rules/selection-set-depth) + */ + '@graphql-eslint/selection-set-depth': SelectionSetDepthRuleConfig; +} diff --git a/src/rules/graphql-eslint/strict-id-in-types.d.ts b/src/rules/graphql-eslint/strict-id-in-types.d.ts new file mode 100644 index 00000000..5ea95d88 --- /dev/null +++ b/src/rules/graphql-eslint/strict-id-in-types.d.ts @@ -0,0 +1,62 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @maxItems 1 + */ +export type StrictIdInTypesOption = + | [] + | [ + { + /** + * @minItems 1 + */ + acceptedIdNames?: [string, ...string[]]; + /** + * @minItems 1 + */ + acceptedIdTypes?: [string, ...string[]]; + exceptions?: { + /** + * This is used to exclude types with names that match one of the specified values. + * + * @minItems 1 + */ + types?: [string, ...string[]]; + /** + * This is used to exclude types with names with suffixes that match one of the specified values. + * + * @minItems 1 + */ + suffixes?: [string, ...string[]]; + }; + }, + ]; + +/** + * Options. + */ +export type StrictIdInTypesOptions = StrictIdInTypesOption; + +/** + * Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers. + * + * @see [strict-id-in-types](https://the-guild.dev/graphql/eslint/rules/strict-id-in-types) + */ +export type StrictIdInTypesRuleConfig = RuleConfig; + +/** + * Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers. + * + * @see [strict-id-in-types](https://the-guild.dev/graphql/eslint/rules/strict-id-in-types) + */ +export interface StrictIdInTypesRule { + /** + * Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers. + * + * @see [strict-id-in-types](https://the-guild.dev/graphql/eslint/rules/strict-id-in-types) + */ + '@graphql-eslint/strict-id-in-types': StrictIdInTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-argument-names.d.ts b/src/rules/graphql-eslint/unique-argument-names.d.ts new file mode 100644 index 00000000..ff8cf001 --- /dev/null +++ b/src/rules/graphql-eslint/unique-argument-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL field or directive is only valid if all supplied arguments are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-argument-names](https://the-guild.dev/graphql/eslint/rules/unique-argument-names) + */ +export type UniqueArgumentNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL field or directive is only valid if all supplied arguments are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-argument-names](https://the-guild.dev/graphql/eslint/rules/unique-argument-names) + */ +export interface UniqueArgumentNamesRule { + /** + * A GraphQL field or directive is only valid if all supplied arguments are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-argument-names](https://the-guild.dev/graphql/eslint/rules/unique-argument-names) + */ + '@graphql-eslint/unique-argument-names': UniqueArgumentNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-directive-names-per-location.d.ts b/src/rules/graphql-eslint/unique-directive-names-per-location.d.ts new file mode 100644 index 00000000..fd2c474c --- /dev/null +++ b/src/rules/graphql-eslint/unique-directive-names-per-location.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names-per-location](https://the-guild.dev/graphql/eslint/rules/unique-directive-names-per-location) + */ +export type UniqueDirectiveNamesPerLocationRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names-per-location](https://the-guild.dev/graphql/eslint/rules/unique-directive-names-per-location) + */ +export interface UniqueDirectiveNamesPerLocationRule { + /** + * A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names-per-location](https://the-guild.dev/graphql/eslint/rules/unique-directive-names-per-location) + */ + '@graphql-eslint/unique-directive-names-per-location': UniqueDirectiveNamesPerLocationRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-directive-names.d.ts b/src/rules/graphql-eslint/unique-directive-names.d.ts new file mode 100644 index 00000000..8f1932ad --- /dev/null +++ b/src/rules/graphql-eslint/unique-directive-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all defined directives have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names](https://the-guild.dev/graphql/eslint/rules/unique-directive-names) + */ +export type UniqueDirectiveNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all defined directives have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names](https://the-guild.dev/graphql/eslint/rules/unique-directive-names) + */ +export interface UniqueDirectiveNamesRule { + /** + * A GraphQL document is only valid if all defined directives have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-directive-names](https://the-guild.dev/graphql/eslint/rules/unique-directive-names) + */ + '@graphql-eslint/unique-directive-names': UniqueDirectiveNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-enum-value-names.d.ts b/src/rules/graphql-eslint/unique-enum-value-names.d.ts new file mode 100644 index 00000000..031a221c --- /dev/null +++ b/src/rules/graphql-eslint/unique-enum-value-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL enum type is only valid if all its values are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-enum-value-names](https://the-guild.dev/graphql/eslint/rules/unique-enum-value-names) + */ +export type UniqueEnumValueNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL enum type is only valid if all its values are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-enum-value-names](https://the-guild.dev/graphql/eslint/rules/unique-enum-value-names) + */ +export interface UniqueEnumValueNamesRule { + /** + * A GraphQL enum type is only valid if all its values are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-enum-value-names](https://the-guild.dev/graphql/eslint/rules/unique-enum-value-names) + */ + '@graphql-eslint/unique-enum-value-names': UniqueEnumValueNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-field-definition-names.d.ts b/src/rules/graphql-eslint/unique-field-definition-names.d.ts new file mode 100644 index 00000000..e281a026 --- /dev/null +++ b/src/rules/graphql-eslint/unique-field-definition-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL complex type is only valid if all its fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-field-definition-names](https://the-guild.dev/graphql/eslint/rules/unique-field-definition-names) + */ +export type UniqueFieldDefinitionNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL complex type is only valid if all its fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-field-definition-names](https://the-guild.dev/graphql/eslint/rules/unique-field-definition-names) + */ +export interface UniqueFieldDefinitionNamesRule { + /** + * A GraphQL complex type is only valid if all its fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-field-definition-names](https://the-guild.dev/graphql/eslint/rules/unique-field-definition-names) + */ + '@graphql-eslint/unique-field-definition-names': UniqueFieldDefinitionNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-fragment-name.d.ts b/src/rules/graphql-eslint/unique-fragment-name.d.ts new file mode 100644 index 00000000..bb66a321 --- /dev/null +++ b/src/rules/graphql-eslint/unique-fragment-name.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Enforce unique fragment names across your project. + * + * @see [unique-fragment-name](https://the-guild.dev/graphql/eslint/rules/unique-fragment-name) + */ +export type UniqueFragmentNameRuleConfig = RuleConfig<[]>; + +/** + * Enforce unique fragment names across your project. + * + * @see [unique-fragment-name](https://the-guild.dev/graphql/eslint/rules/unique-fragment-name) + */ +export interface UniqueFragmentNameRule { + /** + * Enforce unique fragment names across your project. + * + * @see [unique-fragment-name](https://the-guild.dev/graphql/eslint/rules/unique-fragment-name) + */ + '@graphql-eslint/unique-fragment-name': UniqueFragmentNameRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-input-field-names.d.ts b/src/rules/graphql-eslint/unique-input-field-names.d.ts new file mode 100644 index 00000000..bb49392f --- /dev/null +++ b/src/rules/graphql-eslint/unique-input-field-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL input object value is only valid if all supplied fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-input-field-names](https://the-guild.dev/graphql/eslint/rules/unique-input-field-names) + */ +export type UniqueInputFieldNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL input object value is only valid if all supplied fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-input-field-names](https://the-guild.dev/graphql/eslint/rules/unique-input-field-names) + */ +export interface UniqueInputFieldNamesRule { + /** + * A GraphQL input object value is only valid if all supplied fields are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-input-field-names](https://the-guild.dev/graphql/eslint/rules/unique-input-field-names) + */ + '@graphql-eslint/unique-input-field-names': UniqueInputFieldNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-operation-name.d.ts b/src/rules/graphql-eslint/unique-operation-name.d.ts new file mode 100644 index 00000000..d9b32609 --- /dev/null +++ b/src/rules/graphql-eslint/unique-operation-name.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Enforce unique operation names across your project. + * + * @see [unique-operation-name](https://the-guild.dev/graphql/eslint/rules/unique-operation-name) + */ +export type UniqueOperationNameRuleConfig = RuleConfig<[]>; + +/** + * Enforce unique operation names across your project. + * + * @see [unique-operation-name](https://the-guild.dev/graphql/eslint/rules/unique-operation-name) + */ +export interface UniqueOperationNameRule { + /** + * Enforce unique operation names across your project. + * + * @see [unique-operation-name](https://the-guild.dev/graphql/eslint/rules/unique-operation-name) + */ + '@graphql-eslint/unique-operation-name': UniqueOperationNameRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-operation-types.d.ts b/src/rules/graphql-eslint/unique-operation-types.d.ts new file mode 100644 index 00000000..529a4d08 --- /dev/null +++ b/src/rules/graphql-eslint/unique-operation-types.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if it has only one type per operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-operation-types](https://the-guild.dev/graphql/eslint/rules/unique-operation-types) + */ +export type UniqueOperationTypesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if it has only one type per operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-operation-types](https://the-guild.dev/graphql/eslint/rules/unique-operation-types) + */ +export interface UniqueOperationTypesRule { + /** + * A GraphQL document is only valid if it has only one type per operation. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-operation-types](https://the-guild.dev/graphql/eslint/rules/unique-operation-types) + */ + '@graphql-eslint/unique-operation-types': UniqueOperationTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-type-names.d.ts b/src/rules/graphql-eslint/unique-type-names.d.ts new file mode 100644 index 00000000..215e8ee2 --- /dev/null +++ b/src/rules/graphql-eslint/unique-type-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all defined types have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-type-names](https://the-guild.dev/graphql/eslint/rules/unique-type-names) + */ +export type UniqueTypeNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all defined types have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-type-names](https://the-guild.dev/graphql/eslint/rules/unique-type-names) + */ +export interface UniqueTypeNamesRule { + /** + * A GraphQL document is only valid if all defined types have unique names. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-type-names](https://the-guild.dev/graphql/eslint/rules/unique-type-names) + */ + '@graphql-eslint/unique-type-names': UniqueTypeNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/unique-variable-names.d.ts b/src/rules/graphql-eslint/unique-variable-names.d.ts new file mode 100644 index 00000000..0a9a7cdb --- /dev/null +++ b/src/rules/graphql-eslint/unique-variable-names.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL operation is only valid if all its variables are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-variable-names](https://the-guild.dev/graphql/eslint/rules/unique-variable-names) + */ +export type UniqueVariableNamesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL operation is only valid if all its variables are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-variable-names](https://the-guild.dev/graphql/eslint/rules/unique-variable-names) + */ +export interface UniqueVariableNamesRule { + /** + * A GraphQL operation is only valid if all its variables are uniquely named. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [unique-variable-names](https://the-guild.dev/graphql/eslint/rules/unique-variable-names) + */ + '@graphql-eslint/unique-variable-names': UniqueVariableNamesRuleConfig; +} diff --git a/src/rules/graphql-eslint/value-literals-of-correct-type.d.ts b/src/rules/graphql-eslint/value-literals-of-correct-type.d.ts new file mode 100644 index 00000000..f9c30c00 --- /dev/null +++ b/src/rules/graphql-eslint/value-literals-of-correct-type.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL document is only valid if all value literals are of the type expected at their position. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [value-literals-of-correct-type](https://the-guild.dev/graphql/eslint/rules/value-literals-of-correct-type) + */ +export type ValueLiteralsOfCorrectTypeRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL document is only valid if all value literals are of the type expected at their position. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [value-literals-of-correct-type](https://the-guild.dev/graphql/eslint/rules/value-literals-of-correct-type) + */ +export interface ValueLiteralsOfCorrectTypeRule { + /** + * A GraphQL document is only valid if all value literals are of the type expected at their position. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [value-literals-of-correct-type](https://the-guild.dev/graphql/eslint/rules/value-literals-of-correct-type) + */ + '@graphql-eslint/value-literals-of-correct-type': ValueLiteralsOfCorrectTypeRuleConfig; +} diff --git a/src/rules/graphql-eslint/variables-are-input-types.d.ts b/src/rules/graphql-eslint/variables-are-input-types.d.ts new file mode 100644 index 00000000..391360b8 --- /dev/null +++ b/src/rules/graphql-eslint/variables-are-input-types.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object). +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-are-input-types](https://the-guild.dev/graphql/eslint/rules/variables-are-input-types) + */ +export type VariablesAreInputTypesRuleConfig = RuleConfig<[]>; + +/** + * A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object). +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-are-input-types](https://the-guild.dev/graphql/eslint/rules/variables-are-input-types) + */ +export interface VariablesAreInputTypesRule { + /** + * A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object). +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-are-input-types](https://the-guild.dev/graphql/eslint/rules/variables-are-input-types) + */ + '@graphql-eslint/variables-are-input-types': VariablesAreInputTypesRuleConfig; +} diff --git a/src/rules/graphql-eslint/variables-in-allowed-position.d.ts b/src/rules/graphql-eslint/variables-in-allowed-position.d.ts new file mode 100644 index 00000000..e0e70bd6 --- /dev/null +++ b/src/rules/graphql-eslint/variables-in-allowed-position.d.ts @@ -0,0 +1,25 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Variables passed to field arguments conform to type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-in-allowed-position](https://the-guild.dev/graphql/eslint/rules/variables-in-allowed-position) + */ +export type VariablesInAllowedPositionRuleConfig = RuleConfig<[]>; + +/** + * Variables passed to field arguments conform to type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-in-allowed-position](https://the-guild.dev/graphql/eslint/rules/variables-in-allowed-position) + */ +export interface VariablesInAllowedPositionRule { + /** + * Variables passed to field arguments conform to type. +> This rule is a wrapper around a `graphql-js` validation function. + * + * @see [variables-in-allowed-position](https://the-guild.dev/graphql/eslint/rules/variables-in-allowed-position) + */ + '@graphql-eslint/variables-in-allowed-position': VariablesInAllowedPositionRuleConfig; +} diff --git a/src/rules/index.d.ts b/src/rules/index.d.ts index bf959e62..c5e052df 100644 --- a/src/rules/index.d.ts +++ b/src/rules/index.d.ts @@ -1,6 +1,7 @@ import type { DeprecationRules } from './deprecation'; import type { EslintRules } from './eslint'; import type { EslintCommentsRules } from './eslint-comments'; +import type { GraphQLRules } from './graphql-eslint'; import type { ImportRules } from './import'; import type { JSDocRules } from './jsdoc'; import type { JsoncRules } from './jsonc'; @@ -25,6 +26,7 @@ export type Rules = Partial< DeprecationRules & EslintRules & EslintCommentsRules & + GraphQLRules & ImportRules & JSDocRules & JsoncRules &