lib/config/config-initializer.js
function getModulesList(config, installESLint) {
    const modules = {};

    // Create a list of modules which should be installed based on config
    if (config.plugins) {
        for (const plugin of config.plugins) {
            modules[`eslint-plugin-${plugin}`] = "latest";
        }
    }
    if (config.extends && config.extends.indexOf("eslint:") === -1) {
        const moduleName = `eslint-config-${config.extends}`;

        modules[moduleName] = "latest";
        Object.assign(
            modules,
            getPeerDependencies(`${moduleName}@latest`)
        );
    }

    if (installESLint === false) {
        delete modules.eslint;
    } else {
        const installStatus = npmUtils.checkDevDeps(["eslint"]);

        // Mark to show messages if it's new installation of eslint.
        if (installStatus.eslint === false) {
            log.info("Local ESLint installation not found.");
            modules.eslint = modules.eslint || "latest";
            config.installedESLint = true;
        }
    }

    return Object.keys(modules).map(name => `${name}@${modules[name]}`);
}
function getModulesList(config, installESLint) {
    const modules = {};

    // Create a list of modules which should be installed based on config
    if (config.plugins) {
        for (const plugin of config.plugins) {
            modules[`eslint-plugin-${plugin}`] = "latest";
        }
    }
    if (config.extends && config.extends.indexOf("eslint:") === -1) {
        const moduleName = `eslint-config-${config.extends}`;

        modules[moduleName] = "latest";
        Object.assign(
            modules,
            getPeerDependencies(`${moduleName}@latest`)
        );
    }

    if (installESLint === false) {
        delete modules.eslint;
    } else {
        const installStatus = npmUtils.checkDevDeps(["eslint"]);

        // Mark to show messages if it's new installation of eslint.
        if (installStatus.eslint === false) {
            log.info("Local ESLint installation not found.");
            modules.eslint = modules.eslint || "latest";
            config.installedESLint = true;
        }
    }

    return Object.keys(modules).map(name => `${name}@${modules[name]}`);
}
function getModulesList ( config , installESLint ) { const modules = { } ; // Create a list of modules which should be installed based on config if ( config . plugins ) { for ( const plugin of config . plugins ) { modules [ ` ${ plugin } ` ] = "latest" ; } } if ( config . extends && config . extends . indexOf ( "eslint:" ) === - 1 ) { const moduleName = ` ${ config . extends } ` ; modules [ moduleName ] = "latest" ; Object . assign ( modules , getPeerDependencies ( ` ${ moduleName } ` ) ) ; } if ( installESLint === false ) { delete modules . eslint ; } else { const installStatus = npmUtils . checkDevDeps ( [ "eslint" ] ) ; // Mark to show messages if it's new installation of eslint. if ( installStatus . eslint === false ) { log . info ( "Local ESLint installation not found." ) ; modules . eslint = modules . eslint || "latest" ; config . installedESLint = true ; } } return Object . keys ( modules ) . map ( name => ` ${ name } ${ modules [ name ] } ` ) ; }
Return necessary plugins, configs, parsers, etc. based on the config
@param   {Object} config  config object
@param   {boolean} [installESLint=true]  If `false` is given, it does not install eslint.
@returns {string[]} An array of modules to be installed.
Return necessary plugins configs parsers etc . based on the config