function handleImportsExports(
	context,
	modules,
	declarationType,
	includeExports,
) {
	return function (node) {
		const module = getModule(node);

		if (module) {
			checkAndReport(
				context,
				node,
				modules,
				declarationType,
				includeExports,
			);
			const currentNode = { node, declarationType };
			let nodes = [currentNode];

			if (modules.has(module)) {
				const previousNodes = modules.get(module);

				nodes = [...previousNodes, currentNode];
			}
			modules.set(module, nodes);
		}
	};
}
Returns a function handling the (imports|exports) of a given file
@param {RuleContext} context The ESLint rule context object.
@param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type.
@param {string} declarationType A declaration type can be an import or export.
@param {boolean} includeExports Whether or not to check for exports in addition to imports.
@returns {nodeCallback} A function passed to ESLint to handle the statement.