From 44b8aa251fe17495c01a33eb3330e8c0f8e49b20 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Tue, 19 May 2020 04:15:57 +0300 Subject: [PATCH] Enable linting for istanbul ignore comments --- .eslintrc.yml | 9 +++++++++ package-lock.json | 6 ++++++ package.json | 1 + src/__tests__/version-test.js | 4 ++-- src/error/GraphQLError.js | 2 +- src/execution/execute.js | 2 +- src/execution/values.js | 2 +- src/jsutils/__tests__/inspect-test.js | 7 ++++--- src/jsutils/__tests__/isCollection-test.js | 2 +- src/jsutils/dedent.js | 2 +- src/jsutils/defineInspect.js | 2 +- src/jsutils/devAssert.js | 2 +- src/jsutils/instanceOf.js | 2 +- src/jsutils/invariant.js | 2 +- src/jsutils/nodejsCustomInspectSymbol.js | 2 +- src/language/__tests__/visitor-test.js | 2 +- src/polyfills/arrayFrom.js | 2 +- src/polyfills/symbols.js | 6 +++--- .../__tests__/mapAsyncIterator-test.js | 8 ++++---- src/subscription/__tests__/subscribe-test.js | 4 ++-- src/type/__tests__/definition-test.js | 2 +- src/type/__tests__/introspection-test.js | 2 +- src/type/validate.js | 2 +- .../__tests__/stripIgnoredCharacters-test.js | 3 +-- src/utilities/extendSchema.js | 14 +++++++------- src/validation/rules/KnownArgumentNamesRule.js | 2 +- .../rules/OverlappingFieldsCanBeMergedRule.js | 4 ++-- .../rules/ProvidedRequiredArgumentsRule.js | 6 +++--- src/validation/rules/UniqueEnumValueNamesRule.js | 2 +- .../rules/UniqueFieldDefinitionNamesRule.js | 2 +- src/validation/rules/UniqueOperationTypesRule.js | 2 +- 31 files changed, 63 insertions(+), 47 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 57b5887479..1bc9b09dfe 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -9,6 +9,7 @@ plugins: - graphql-internal - flowtype - node + - istanbul - import rules: @@ -67,6 +68,14 @@ rules: flowtype/space-before-type-colon: off flowtype/union-intersection-spacing: off + ############################################################################## + # `eslint-plugin-istanbul` rule list based on `v0.1.1` + # https://github.com/istanbuljs/eslint-plugin-istanbul#rules + ############################################################################## + + istanbul/no-ignore-file: error + istanbul/prefer-ignore-reason: error + ############################################################################## # `eslint-plugin-node` rule list based on `v11.1.x` ############################################################################## diff --git a/package-lock.json b/package-lock.json index 07e1cc814d..825c186559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2923,6 +2923,12 @@ } } }, + "eslint-plugin-istanbul": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-istanbul/-/eslint-plugin-istanbul-0.1.1.tgz", + "integrity": "sha512-onXVghQLkS0AQmdVm2qEbUo14ZEao7S3LZHGaiABaSi2Bt33GxsG6yWpMzT15SzuuCrQvVfdFY4xMS1y4ad6BA==", + "dev": true + }, "eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", diff --git a/package.json b/package.json index 9618a616cb..bdf39204e3 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "eslint-plugin-flowtype": "5.1.0", "eslint-plugin-graphql-internal": "file:./resources/eslint-rules", "eslint-plugin-import": "2.20.2", + "eslint-plugin-istanbul": "0.1.1", "eslint-plugin-node": "11.1.0", "flow-bin": "0.125.1", "mocha": "7.1.2", diff --git a/src/__tests__/version-test.js b/src/__tests__/version-test.js index b6fde05200..928c5d8094 100644 --- a/src/__tests__/version-test.js +++ b/src/__tests__/version-test.js @@ -26,14 +26,14 @@ describe('Version', () => { expect(minor).to.be.a('number'); expect(patch).to.be.a('number'); - /* istanbul ignore next (Can't be verified on all versions) */ + // istanbul ignore next (Can't be verified on all versions) if (preReleaseTag !== null) { expect(preReleaseTag).to.be.a('string'); } expect( `${major}.${minor}.${patch}` + - /* istanbul ignore next (Can't be verified on all versions) */ + // istanbul ignore next (Can't be verified on all versions) (preReleaseTag !== null ? '-' + preReleaseTag : ''), ).to.equal(version); }); diff --git a/src/error/GraphQLError.js b/src/error/GraphQLError.js index d3af8d2cf7..c7c571d9ae 100644 --- a/src/error/GraphQLError.js +++ b/src/error/GraphQLError.js @@ -196,7 +196,7 @@ export class GraphQLError extends Error { return; } - /* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ + // istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) if (Error.captureStackTrace) { Error.captureStackTrace(this, GraphQLError); } else { diff --git a/src/execution/execute.js b/src/execution/execute.js index a78df7729a..d0536eec8d 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -311,7 +311,7 @@ export function buildExecutionContext( return [new GraphQLError('Must provide an operation.')]; } - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const variableDefinitions = operation.variableDefinitions ?? []; const coercedVariableValues = getVariableValues( diff --git a/src/execution/values.js b/src/execution/values.js index aaafd51d95..b8416c2d4e 100644 --- a/src/execution/values.js +++ b/src/execution/values.js @@ -170,7 +170,7 @@ export function getArgumentValues( ): { [argument: string]: mixed, ... } { const coercedValues = {}; - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argumentNodes = node.arguments ?? []; const argNodeMap = keyMap(argumentNodes, (arg) => arg.name.value); diff --git a/src/jsutils/__tests__/inspect-test.js b/src/jsutils/__tests__/inspect-test.js index e72b5ffb25..6180903915 100644 --- a/src/jsutils/__tests__/inspect-test.js +++ b/src/jsutils/__tests__/inspect-test.js @@ -37,11 +37,12 @@ describe('inspect', () => { it('function', () => { const unnamedFuncStr = inspect( - /* istanbul ignore next */ () => invariant(false), + // istanbul ignore next (never called and used as a placeholder) + () => invariant(false), ); expect(unnamedFuncStr).to.equal('[function]'); - /* istanbul ignore next */ + // istanbul ignore next (never called and used as a placeholder) function namedFunc() { invariant(false); } @@ -107,7 +108,7 @@ describe('inspect', () => { it('custom symbol inspect is take precedence', () => { const object = { - /* istanbul ignore next */ + // istanbul ignore next (never called and use just as a placeholder) inspect() { invariant(false); }, diff --git a/src/jsutils/__tests__/isCollection-test.js b/src/jsutils/__tests__/isCollection-test.js index caa105f555..be42b781f6 100644 --- a/src/jsutils/__tests__/isCollection-test.js +++ b/src/jsutils/__tests__/isCollection-test.js @@ -30,7 +30,7 @@ describe('isCollection', () => { const iterator = { [Symbol.iterator]: identityFunc }; expect(isCollection(iterator)).to.equal(true); - // istanbul ignore next + // istanbul ignore next (never called and use just as a placeholder) function* generatorFunc() { /* do nothing */ } diff --git a/src/jsutils/dedent.js b/src/jsutils/dedent.js index a34a23aece..0dbdc6c697 100644 --- a/src/jsutils/dedent.js +++ b/src/jsutils/dedent.js @@ -21,7 +21,7 @@ export default function dedent( for (let i = 0; i < strings.length; ++i) { str += strings[i]; if (i < values.length) { - /* istanbul ignore next (ignore else inside Babel generated code) */ + // istanbul ignore next (ignore else inside Babel generated code) const value = values[i]; str += value; // interpolation diff --git a/src/jsutils/defineInspect.js b/src/jsutils/defineInspect.js index 5e2a11c3cb..f50807413d 100644 --- a/src/jsutils/defineInspect.js +++ b/src/jsutils/defineInspect.js @@ -14,7 +14,7 @@ export default function defineInspect( classObject.prototype.inspect = fn; - /* istanbul ignore else (See: https://github.com/graphql/graphql-js/issues/2317) */ + // istanbul ignore else (See: https://github.com/graphql/graphql-js/issues/2317) if (nodejsCustomInspectSymbol) { classObject.prototype[nodejsCustomInspectSymbol] = fn; } diff --git a/src/jsutils/devAssert.js b/src/jsutils/devAssert.js index 4d465c4539..147de378a3 100644 --- a/src/jsutils/devAssert.js +++ b/src/jsutils/devAssert.js @@ -2,7 +2,7 @@ export default function devAssert(condition: mixed, message: string): void { const booleanCondition = Boolean(condition); - /* istanbul ignore else (see transformation done in './resources/inlineInvariant.js') */ + // istanbul ignore else (see transformation done in './resources/inlineInvariant.js') if (!booleanCondition) { throw new Error(message); } diff --git a/src/jsutils/instanceOf.js b/src/jsutils/instanceOf.js index e944809396..b721e75a6f 100644 --- a/src/jsutils/instanceOf.js +++ b/src/jsutils/instanceOf.js @@ -12,7 +12,7 @@ declare function instanceOf( // See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production // See: https://webpack.js.org/guides/production/ export default process.env.NODE_ENV === 'production' - ? /* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ + ? // istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) // eslint-disable-next-line no-shadow function instanceOf(value: mixed, constructor: mixed) { return value instanceof constructor; diff --git a/src/jsutils/invariant.js b/src/jsutils/invariant.js index f3af549ac3..04ec1a5e28 100644 --- a/src/jsutils/invariant.js +++ b/src/jsutils/invariant.js @@ -2,7 +2,7 @@ export default function invariant(condition: mixed, message?: string): void { const booleanCondition = Boolean(condition); - /* istanbul ignore else (see transformation done in './resources/inlineInvariant.js') */ + // istanbul ignore else (see transformation done in './resources/inlineInvariant.js') if (!booleanCondition) { throw new Error( message != null ? message : 'Unexpected invariant triggered.', diff --git a/src/jsutils/nodejsCustomInspectSymbol.js b/src/jsutils/nodejsCustomInspectSymbol.js index a884a47572..27a83be897 100644 --- a/src/jsutils/nodejsCustomInspectSymbol.js +++ b/src/jsutils/nodejsCustomInspectSymbol.js @@ -1,6 +1,6 @@ // @flow strict -/* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ +// istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) const nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') diff --git a/src/language/__tests__/visitor-test.js b/src/language/__tests__/visitor-test.js index c4bcf1d687..308e9711ee 100644 --- a/src/language/__tests__/visitor-test.js +++ b/src/language/__tests__/visitor-test.js @@ -1132,7 +1132,7 @@ describe('Visitor', () => { return BREAK; } }, - /* istanbul ignore next */ + // istanbul ignore next (never called and used as a placeholder) leave() { invariant(false); }, diff --git a/src/polyfills/arrayFrom.js b/src/polyfills/arrayFrom.js index f10ae58d08..871792ee60 100644 --- a/src/polyfills/arrayFrom.js +++ b/src/polyfills/arrayFrom.js @@ -32,7 +32,7 @@ const arrayFrom = result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever. // After a very large number of iterations, produce an error. - /* istanbul ignore if */ + // istanbul ignore if (too big to actually test) if (i > 9999999) { throw new TypeError('Near-infinite iteration.'); } diff --git a/src/polyfills/symbols.js b/src/polyfills/symbols.js index af2d2673a6..7155a758ca 100644 --- a/src/polyfills/symbols.js +++ b/src/polyfills/symbols.js @@ -1,17 +1,17 @@ // @flow strict // In ES2015 (or a polyfilled) environment, this will be Symbol.iterator -/* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ +// istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) export const SYMBOL_ITERATOR: string = typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator -/* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ +// istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) export const SYMBOL_ASYNC_ITERATOR: string = // $FlowFixMe Flow doesn't define `Symbol.asyncIterator` yet typeof Symbol === 'function' ? Symbol.asyncIterator : '@@asyncIterator'; -/* istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) */ +// istanbul ignore next (See: https://github.com/graphql/graphql-js/issues/2317) export const SYMBOL_TO_STRING_TAG: string = // $FlowFixMe Flow doesn't define `Symbol.toStringTag` yet typeof Symbol === 'function' ? Symbol.toStringTag : '@@toStringTag'; diff --git a/src/subscription/__tests__/mapAsyncIterator-test.js b/src/subscription/__tests__/mapAsyncIterator-test.js index 30fdf396ad..4815dd2064 100644 --- a/src/subscription/__tests__/mapAsyncIterator-test.js +++ b/src/subscription/__tests__/mapAsyncIterator-test.js @@ -96,7 +96,7 @@ describe('mapAsyncIterator', () => { yield 1; yield 2; - /* istanbul ignore next (shouldn't be reached) */ + // istanbul ignore next (shouldn't be reached) yield 3; } @@ -156,7 +156,7 @@ describe('mapAsyncIterator', () => { yield 1; yield 2; - /* istanbul ignore next (shouldn't be reached) */ + // istanbul ignore next (shouldn't be reached) yield 3; } finally { yield 'Done'; @@ -223,7 +223,7 @@ describe('mapAsyncIterator', () => { yield 1; yield 2; - /* istanbul ignore next (shouldn't be reached) */ + // istanbul ignore next (shouldn't be reached) yield 3; } catch (e) { yield e; @@ -311,7 +311,7 @@ describe('mapAsyncIterator', () => { yield 1; yield 2; - /* istanbul ignore next (shouldn't be reached) */ + // istanbul ignore next (shouldn't be reached) yield 3; } finally { didVisitFinally = true; diff --git a/src/subscription/__tests__/subscribe-test.js b/src/subscription/__tests__/subscribe-test.js index 08bf3bdcdc..22431c9eff 100644 --- a/src/subscription/__tests__/subscribe-test.js +++ b/src/subscription/__tests__/subscribe-test.js @@ -136,7 +136,7 @@ async function createSubscription( async function expectPromiseToThrow(promise, message) { try { await promise(); - /* istanbul ignore next */ + // istanbul ignore next(shouldn't be reached) expect.fail('promise should have thrown but did not'); } catch (error) { expect(error).to.be.an.instanceOf(Error); @@ -280,7 +280,7 @@ describe('Subscription Initialization Phase', () => { }, nonImportantEmail: { type: EmailEventType, - /* istanbul ignore next (shouldn't be called) */ + // istanbul ignore next (shouldn't be called) subscribe() { didResolveNonImportantEmail = true; return eventEmitterAsyncIterator(new EventEmitter(), 'event'); diff --git a/src/type/__tests__/definition-test.js b/src/type/__tests__/definition-test.js index bc26f58cb2..314997cb60 100644 --- a/src/type/__tests__/definition-test.js +++ b/src/type/__tests__/definition-test.js @@ -39,7 +39,7 @@ const NonNullScalarType = GraphQLNonNull(ScalarType); const ListOfNonNullScalarsType = GraphQLList(NonNullScalarType); const NonNullListOfScalars = GraphQLNonNull(ListOfScalarsType); -/* istanbul ignore next */ +// istanbul ignore next (never called and used as a placeholder) const dummyFunc = () => { /* empty */ }; diff --git a/src/type/__tests__/introspection-test.js b/src/type/__tests__/introspection-test.js index 1da64836c2..4e7c47a422 100644 --- a/src/type/__tests__/introspection-test.js +++ b/src/type/__tests__/introspection-test.js @@ -1476,7 +1476,7 @@ describe('Introspection', () => { const schema = new GraphQLSchema({ query: QueryRoot }); const source = getIntrospectionQuery({ directiveIsRepeatable: true }); - /* istanbul ignore next */ + // istanbul ignore next (called only to fail test) function fieldResolver(_1, _2, _3, info) { invariant(false, `Called on ${info.parentType.name}::${info.fieldName}`); } diff --git a/src/type/validate.js b/src/type/validate.js index 7126aa9640..d43702f225 100644 --- a/src/type/validate.js +++ b/src/type/validate.js @@ -588,7 +588,7 @@ function getAllSubNodes( object: SDLDefinedObject, getter: (T | K) => ?(L | $ReadOnlyArray), ): $ReadOnlyArray { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) return flatMap(getAllNodes(object), (item) => getter(item) ?? []); } diff --git a/src/utilities/__tests__/stripIgnoredCharacters-test.js b/src/utilities/__tests__/stripIgnoredCharacters-test.js index 6e162ba1fe..c0c6fe67dc 100644 --- a/src/utilities/__tests__/stripIgnoredCharacters-test.js +++ b/src/utilities/__tests__/stripIgnoredCharacters-test.js @@ -66,8 +66,7 @@ function lexValue(str) { return value; } -// Called only to make error messages for failing tests -/* istanbul ignore next */ +// istanbul ignore next (called only to make error messages for failing tests) function inspectStr(str) { return (JSON.stringify(str) ?? '') .replace(/^"|"$/g, '`') diff --git a/src/utilities/extendSchema.js b/src/utilities/extendSchema.js index 8265973387..1cf4de1932 100644 --- a/src/utilities/extendSchema.js +++ b/src/utilities/extendSchema.js @@ -415,7 +415,7 @@ export function extendSchemaImpl( |} { const opTypes = {}; for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const operationTypesNodes = node.operationTypes ?? []; for (const operationType of operationTypesNodes) { @@ -474,7 +474,7 @@ export function extendSchemaImpl( ): GraphQLFieldConfigMap { const fieldConfigMap = Object.create(null); for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const nodeFields = node.fields ?? []; for (const field of nodeFields) { @@ -496,7 +496,7 @@ export function extendSchemaImpl( function buildArgumentMap( args: ?$ReadOnlyArray, ): GraphQLFieldConfigArgumentMap { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argsNodes = args ?? []; const argConfigMap = Object.create(null); @@ -523,7 +523,7 @@ export function extendSchemaImpl( ): GraphQLInputFieldConfigMap { const inputFieldMap = Object.create(null); for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const fieldsNodes = node.fields ?? []; for (const field of fieldsNodes) { @@ -548,7 +548,7 @@ export function extendSchemaImpl( ): GraphQLEnumValueConfigMap { const enumValueMap = Object.create(null); for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const valuesNodes = node.values ?? []; for (const value of valuesNodes) { @@ -572,7 +572,7 @@ export function extendSchemaImpl( ): Array { const interfaces = []; for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const interfacesNodes = node.interfaces ?? []; for (const type of interfacesNodes) { @@ -591,7 +591,7 @@ export function extendSchemaImpl( ): Array { const types = []; for (const node of nodes) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const typeNodes = node.types ?? []; for (const type of typeNodes) { diff --git a/src/validation/rules/KnownArgumentNamesRule.js b/src/validation/rules/KnownArgumentNamesRule.js index d397bf2429..14ff27556f 100644 --- a/src/validation/rules/KnownArgumentNamesRule.js +++ b/src/validation/rules/KnownArgumentNamesRule.js @@ -64,7 +64,7 @@ export function KnownArgumentNamesOnDirectivesRule( const astDefinitions = context.getDocument().definitions; for (const def of astDefinitions) { if (def.kind === Kind.DIRECTIVE_DEFINITION) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argsNodes = def.arguments ?? []; directiveArgs[def.name.value] = argsNodes.map((arg) => arg.name.value); diff --git a/src/validation/rules/OverlappingFieldsCanBeMergedRule.js b/src/validation/rules/OverlappingFieldsCanBeMergedRule.js index a8dd722050..702f7f52ce 100644 --- a/src/validation/rules/OverlappingFieldsCanBeMergedRule.js +++ b/src/validation/rules/OverlappingFieldsCanBeMergedRule.js @@ -571,9 +571,9 @@ function findConflict( ]; } - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const args1 = node1.arguments ?? []; - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const args2 = node2.arguments ?? []; // Two field calls must have the same arguments. if (!sameArguments(args1, args2)) { diff --git a/src/validation/rules/ProvidedRequiredArgumentsRule.js b/src/validation/rules/ProvidedRequiredArgumentsRule.js index d72974fe25..89967b3266 100644 --- a/src/validation/rules/ProvidedRequiredArgumentsRule.js +++ b/src/validation/rules/ProvidedRequiredArgumentsRule.js @@ -36,7 +36,7 @@ export function ProvidedRequiredArgumentsRule( return false; } - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argNodes = fieldNode.arguments ?? []; const argNodeMap = keyMap(argNodes, (arg) => arg.name.value); for (const argDef of fieldDef.args) { @@ -78,7 +78,7 @@ export function ProvidedRequiredArgumentsOnDirectivesRule( const astDefinitions = context.getDocument().definitions; for (const def of astDefinitions) { if (def.kind === Kind.DIRECTIVE_DEFINITION) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argNodes = def.arguments ?? []; requiredArgsMap[def.name.value] = keyMap( @@ -95,7 +95,7 @@ export function ProvidedRequiredArgumentsOnDirectivesRule( const directiveName = directiveNode.name.value; const requiredArgs = requiredArgsMap[directiveName]; if (requiredArgs) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const argNodes = directiveNode.arguments ?? []; const argNodeMap = keyMap(argNodes, (arg) => arg.name.value); for (const argName of Object.keys(requiredArgs)) { diff --git a/src/validation/rules/UniqueEnumValueNamesRule.js b/src/validation/rules/UniqueEnumValueNamesRule.js index dac1939abd..926cef6a31 100644 --- a/src/validation/rules/UniqueEnumValueNamesRule.js +++ b/src/validation/rules/UniqueEnumValueNamesRule.js @@ -30,7 +30,7 @@ export function UniqueEnumValueNamesRule( knownValueNames[typeName] = Object.create(null); } - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const valueNodes = node.values ?? []; const valueNames = knownValueNames[typeName]; diff --git a/src/validation/rules/UniqueFieldDefinitionNamesRule.js b/src/validation/rules/UniqueFieldDefinitionNamesRule.js index 2a75e5b89b..9c7b333510 100644 --- a/src/validation/rules/UniqueFieldDefinitionNamesRule.js +++ b/src/validation/rules/UniqueFieldDefinitionNamesRule.js @@ -38,7 +38,7 @@ export function UniqueFieldDefinitionNamesRule( knownFieldNames[typeName] = Object.create(null); } - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const fieldNodes = node.fields ?? []; const fieldNames = knownFieldNames[typeName]; diff --git a/src/validation/rules/UniqueOperationTypesRule.js b/src/validation/rules/UniqueOperationTypesRule.js index 2cd40fc532..dc532a8c46 100644 --- a/src/validation/rules/UniqueOperationTypesRule.js +++ b/src/validation/rules/UniqueOperationTypesRule.js @@ -29,7 +29,7 @@ export function UniqueOperationTypesRule( }; function checkOperationTypes(node) { - /* istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) */ + // istanbul ignore next (See https://github.com/graphql/graphql-js/issues/2203) const operationTypesNodes = node.operationTypes ?? []; for (const operationType of operationTypesNodes) {