lib/config/config-initializer.js
function hasESLintVersionConflict(answers) {

    // Get the local ESLint version.
    const localESLintVersion = getLocalESLintVersion();

    if (!localESLintVersion) {
        return false;
    }

    // Get the required range of ESLint version.
    const configName = getStyleGuideName(answers);
    const moduleName = `eslint-config-${configName}@latest`;
    const peerDependencies = getPeerDependencies(moduleName) || {};
    const requiredESLintVersionRange = peerDependencies.eslint;

    if (!requiredESLintVersionRange) {
        return false;
    }

    answers.localESLintVersion = localESLintVersion;
    answers.requiredESLintVersionRange = requiredESLintVersionRange;

    // Check the version.
    if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) {
        answers.installESLint = false;
        return false;
    }

    return true;
}
function hasESLintVersionConflict(answers) {

    // Get the local ESLint version.
    const localESLintVersion = getLocalESLintVersion();

    if (!localESLintVersion) {
        return false;
    }

    // Get the required range of ESLint version.
    const configName = getStyleGuideName(answers);
    const moduleName = `eslint-config-${configName}@latest`;
    const peerDependencies = getPeerDependencies(moduleName) || {};
    const requiredESLintVersionRange = peerDependencies.eslint;

    if (!requiredESLintVersionRange) {
        return false;
    }

    answers.localESLintVersion = localESLintVersion;
    answers.requiredESLintVersionRange = requiredESLintVersionRange;

    // Check the version.
    if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) {
        answers.installESLint = false;
        return false;
    }

    return true;
}
function hasESLintVersionConflict ( answers ) { // Get the local ESLint version. const localESLintVersion = getLocalESLintVersion ( ) ; if ( ! localESLintVersion ) { return false ; } // Get the required range of ESLint version. const configName = getStyleGuideName ( answers ) ; const moduleName = ` ${ configName } ` ; const peerDependencies = getPeerDependencies ( moduleName ) || { } ; const requiredESLintVersionRange = peerDependencies . eslint ; if ( ! requiredESLintVersionRange ) { return false ; } answers . localESLintVersion = localESLintVersion ; answers . requiredESLintVersionRange = requiredESLintVersionRange ; // Check the version. if ( semver . satisfies ( localESLintVersion , requiredESLintVersionRange ) ) { answers . installESLint = false ; return false ; } return true ; }
Check whether the local ESLint version conflicts with the required version of the chosen shareable config.
@param {Object} answers The answers object.
@returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config.
Check whether the local ESLint version conflicts with the required version of the chosen shareable config .