mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-21 20:08:41 -05:00
fix: fix eslint path resolution in vue serve (#4246)
fixes #4237
(cherry picked from commit 0ba505ca02)
This commit is contained in:
@@ -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')
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user