Skip to content

Commit 077343b

Browse files
committed
fix: specify eslintPath for eslint-loader
fixes #2924
1 parent 5eac2e1 commit 077343b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@vue/cli-plugin-eslint/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = (api, options) => {
44
if (options.lintOnSave) {
55
const extensions = require('./eslintOptions').extensions(api)
66
// Use loadModule to allow users to customize their ESLint dependency version.
7-
const { loadModule } = require('@vue/cli-shared-utils')
7+
const { resolveModule, loadModule } = require('@vue/cli-shared-utils')
88
const cwd = api.getCwd()
99
const eslintPkg =
1010
loadModule('eslint/package.json', cwd, true) ||
@@ -48,6 +48,7 @@ module.exports = (api, options) => {
4848
cacheIdentifier,
4949
emitWarning: options.lintOnSave !== 'error',
5050
emitError: options.lintOnSave === 'error',
51+
eslintPath: resolveModule('eslint', cwd) || require.resolve('eslint'),
5152
formatter:
5253
loadModule('eslint/lib/formatters/codeframe', cwd, true) ||
5354
require('eslint/lib/formatters/codeframe')

0 commit comments

Comments
 (0)