Skip to content

Commit

Permalink
fix(eslint-migrator): fix local eslint major version detection (#5363)
Browse files Browse the repository at this point in the history
closes #5357
  • Loading branch information
sodatea committed Apr 7, 2020
1 parent 9855c52 commit 30b6873
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/@vue/cli-plugin-eslint/migrator/index.js
Expand Up @@ -21,10 +21,11 @@ module.exports = async (api) => {
}

const localESLintMajor = semver.major(
semver.maxSatisfying(
['4.99.0', '5.99.0', '6.99.0'],
localESLintRange
)
semver.maxSatisfying(['4.99.0', '5.99.0', '6.99.0'], localESLintRange) ||
// in case the user does not specify a typical caret range;
// it is used as **fallback** because the user may have not previously
// installed eslint yet, such as in the case that they are from v3.0.x
require('eslint/package.json').version
)

if (localESLintMajor === 6) {
Expand Down

0 comments on commit 30b6873

Please sign in to comment.