Skip to content

Commit e7e184c

Browse files
fix: fix parser loading in yarn v2
1 parent 166bc0d commit e7e184c

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
// in turn delegates to the parser, specified in `parserOptions.parser`:
66
// https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error
77
parserOptions: {
8-
parser: '@typescript-eslint/parser',
8+
parser: require.resolve('@typescript-eslint/parser'),
99
extraFileExtensions: ['.vue'],
1010
ecmaFeatures: {
1111
jsx: true

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@
4343
"@typescript-eslint/parser": "^2.7.0",
4444
"eslint": "^5.0.0 || ^6.0.0",
4545
"eslint-plugin-vue": "^5.2.3 || ^6.0.0"
46+
},
47+
"dependencies": {
48+
"vue-eslint-parser": "^7.0.0"
4649
}
47-
}
50+
}

recommended.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
],
66

77
// the ts-eslint recommended ruleset sets the parser so we need to set it back
8-
parser: 'vue-eslint-parser',
8+
parser: require.resolve('vue-eslint-parser'),
99

1010
rules: {
1111
// this rule, if on, would require explicit return type on the `render` function

yarn.lock

+12
Original file line numberDiff line numberDiff line change
@@ -3981,6 +3981,18 @@ vue-eslint-parser@^6.0.5:
39813981
esquery "^1.0.1"
39823982
lodash "^4.17.11"
39833983

3984+
vue-eslint-parser@^7.0.0:
3985+
version "7.0.0"
3986+
resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-7.0.0.tgz#a4ed2669f87179dedd06afdd8736acbb3a3864d6"
3987+
integrity sha512-yR0dLxsTT7JfD2YQo9BhnQ6bUTLsZouuzt9SKRP7XNaZJV459gvlsJo4vT2nhZ/2dH9j3c53bIx9dnqU2prM9g==
3988+
dependencies:
3989+
debug "^4.1.1"
3990+
eslint-scope "^5.0.0"
3991+
eslint-visitor-keys "^1.1.0"
3992+
espree "^6.1.2"
3993+
esquery "^1.0.1"
3994+
lodash "^4.17.15"
3995+
39843996
vue-property-decorator@^8.3.0:
39853997
version "8.3.0"
39863998
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-8.3.0.tgz#536f027dc7d626f37c8d85a2dc02f0a6cb979440"

0 commit comments

Comments
 (0)