lib/rules/no-duplicate-imports.js
function checkAndReport(context, node, value, array, messageId) {
    if (array.indexOf(value) !== -1) {
        context.report({
            node,
            messageId,
            data: {
                module: value
            }
        });
    }
}
function checkAndReport(context, node, value, array, messageId) {
    if (array.indexOf(value) !== -1) {
        context.report({
            node,
            messageId,
            data: {
                module: value
            }
        });
    }
}
function checkAndReport ( context , node , value , array , messageId ) { if ( array . indexOf ( value ) !== - 1 ) { context . report ( { node , messageId , data : { module : value } } ) ; } }
Checks if the name of the import or export exists in the given array, and reports if so.

@param {RuleContext} context - The ESLint rule context object.
@param {ASTNode} node - A node to get.
@param {string} value - The name of the imported or exported module.
@param {string[]} array - The array containing other imports or exports in the file.
@param {string} messageId - A messageId to be reported after the name of the module

@returns {void} No return value
Checks if the name of the import or export exists in the given array and reports if so .