Skip to content

Commit

Permalink
fix: fix eslint path resolution in vue serve (#4246)
Browse files Browse the repository at this point in the history
fixes #4237

(cherry picked from commit 0ba505c)
  • Loading branch information
sodatea committed Jul 6, 2019
1 parent fc6e0b7 commit 01f7f27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/@vue/cli-plugin-eslint/index.js
Expand Up @@ -43,7 +43,7 @@ module.exports = (api, options) => {
.pre()
.exclude
.add(/node_modules/)
.add(require('path').dirname(require.resolve('@vue/cli-service')))
.add(require('path').dirname(require.resolve('@vue/cli-service'))) // eslint-disable-line
.end()
.test(/\.(vue|(j|t)sx?)$/)
.use('eslint-loader')
Expand All @@ -55,7 +55,10 @@ module.exports = (api, options) => {
emitWarning: allWarnings,
// only emit errors in production mode.
emitError: allErrors,
eslintPath: path.dirname(resolveModule('eslint/package.json', cwd)),
eslintPath: path.dirname(
resolveModule('eslint/package.json', cwd) ||
require.resolve('eslint/package.json')
),
formatter:
loadModule('eslint/lib/formatters/codeframe', cwd, true) ||
require('eslint/lib/formatters/codeframe')
Expand Down

0 comments on commit 01f7f27

Please sign in to comment.