diff --git a/.changeset/cool-spoons-explain.md b/.changeset/cool-spoons-explain.md new file mode 100644 index 00000000000..72979899d66 --- /dev/null +++ b/.changeset/cool-spoons-explain.md @@ -0,0 +1,6 @@ +--- +'@graphql-eslint/eslint-plugin': patch +--- + +fix error from `no-deprecated` rule +`4.0.0-alpha.13: node.typeInfo(...).inputType.getFields is not a function` diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh deleted file mode 100644 index 7c9c33db216..00000000000 --- a/.husky/_/husky.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -if [ -z "$husky_skip_init" ]; then - debug() { - [ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1" - } - - readonly hook_name="$(basename "$0")" - debug "starting $hook_name..." - - if [ "$HUSKY" = "0" ]; then - debug "HUSKY env variable is set to 0, skipping hook" - exit 0 - fi - - if [ -f ~/.huskyrc ]; then - debug "sourcing ~/.huskyrc" - . ~/.huskyrc - fi - - export readonly husky_skip_init=1 - sh -e "$0" "$@" - exitCode="$?" - - if [ $exitCode != 0 ]; then - echo "husky - $hook_name hook exited with code $exitCode (error)" - fi - - exit $exitCode -fi diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 009b3f89bde..00000000000 --- a/.husky/pre-push +++ /dev/null @@ -1 +0,0 @@ -pnpm lint diff --git a/package.json b/package.json index 773481881d9..047e0ba304a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "eslint": "9.14.0", "eslint-plugin-eslint-plugin": "6.3.2", "eslint-plugin-tailwindcss": "3.17.5", - "husky": "9.1.7", "jest-snapshot-serializer-raw": "2.0.0", "json-schema-to-markdown": "1.1.1", "prettier": "3.3.3", diff --git a/packages/plugin/src/rules/no-deprecated/index.ts b/packages/plugin/src/rules/no-deprecated/index.ts index 503952a672d..eee69802742 100644 --- a/packages/plugin/src/rules/no-deprecated/index.ts +++ b/packages/plugin/src/rules/no-deprecated/index.ts @@ -132,14 +132,16 @@ export const rule: GraphQLESLintRule<[], true> = { } }, ObjectValue(node) { - const typeInfo = node.typeInfo(); - // @ts-expect-error -- fixme - const fields = typeInfo.inputType!.getFields(); - for (const field of node.fields) { - const fieldName = field.name.value; - const reason = fields[fieldName].deprecationReason; - if (reason) { - report(field, reason); + const { inputType } = node.typeInfo(); + if (!inputType) return; + if ('getFields' in inputType) { + const fields = inputType.getFields(); + for (const field of node.fields) { + const fieldName = field.name.value; + const reason = fields[fieldName].deprecationReason; + if (reason) { + report(field, reason); + } } } }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ab4796ea49..3fe581cac7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,9 +58,6 @@ importers: eslint-plugin-tailwindcss: specifier: 3.17.5 version: 3.17.5(tailwindcss@3.4.14) - husky: - specifier: 9.1.7 - version: 9.1.7 jest-snapshot-serializer-raw: specifier: 2.0.0 version: 2.0.0 @@ -4778,11 +4775,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -13354,8 +13346,6 @@ snapshots: human-signals@5.0.0: {} - husky@9.1.7: {} - iconv-lite@0.4.24: dependencies: safer-buffer: 2.1.2