File tree 1 file changed +5
-2
lines changed
packages/@vue/cli-plugin-eslint
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = ( api , options ) => {
2
2
if ( options . lintOnSave ) {
3
3
const extensions = require ( './eslintOptions' ) . extensions ( api )
4
+ const { loadModule } = require ( '@vue/cli-shared-utils' )
5
+ const cwd = api . getCwd ( )
6
+ const eslintPkg = loadModule ( 'eslint/package.json' , cwd , true )
4
7
5
8
// eslint-loader doesn't bust cache when eslint config changes
6
9
// so we have to manually generate a cache identifier that takes the config
@@ -9,7 +12,7 @@ module.exports = (api, options) => {
9
12
'eslint-loader' ,
10
13
{
11
14
'eslint-loader' : require ( 'eslint-loader/package.json' ) . version ,
12
- 'eslint' : require ( 'eslint/package.json' ) . version
15
+ 'eslint' : eslintPkg . version
13
16
} ,
14
17
[
15
18
'.eslintrc.js' ,
@@ -38,7 +41,7 @@ module.exports = (api, options) => {
38
41
cacheIdentifier,
39
42
emitWarning : options . lintOnSave !== 'error' ,
40
43
emitError : options . lintOnSave === 'error' ,
41
- formatter : require ( 'eslint/lib/formatters/codeframe' )
44
+ formatter : loadModule ( 'eslint/lib/formatters/codeframe' , cwd , true )
42
45
} )
43
46
} )
44
47
}
You can’t perform that action at this time.
0 commit comments