function * iterateProblemsFromFilename(node, {reportFilenameNode = false} = {}) {
			/** @type {{parent: import('estree').Node}} */
			const {parent} = node;

			// `path.dirname(filename)`
			if (
				isPathDirnameCall(parent, sourceCode)
				&& parent.arguments[0] === node
			) {
				yield getProblem(parent, 'dirname');
				return;
			}

			if (reportFilenameNode) {
				yield getProblem(node, 'filename');
			}

			if (
				parent.type !== 'VariableDeclarator'
				|| parent.init !== node
				|| parent.id.type !== 'Identifier'
				|| parent.parent.type !== 'VariableDeclaration'
				|| parent.parent.kind !== 'const'
			) {
				return;
			}

			/** @type {import('eslint').Scope.Variable|null} */
			const variable = findVariable(sourceCode.getScope(parent.id), parent.id);
			if (!variable) {
				return;
			}

			for (const reference of variable.references) {
				if (!reference.isReadOnly()) {
					continue;
				}

				/** @type {{parent: import('estree').Node}} */
				const {parent} = reference.identifier;
				if (
					isPathDirnameCall(parent, sourceCode)
					&& parent.arguments[0] === reference.identifier
				) {
					// Report `path.dirname(identifier)`
					yield getProblem(parent, 'dirname');
				}
			}
		}
Iterates over reports where a given filename expression node
		would be used to convert it to a dirname.
		@param { import('estree').Expression} node