Skip to content

Commit 3878fc4

Browse files
authored
Upgrade vue-eslint-parser to 7.6.0 (#1448)
close #1292 close #1300 close #1439
1 parent 467ef96 commit 3878fc4

8 files changed

+100
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"eslint-utils": "^2.1.0",
5757
"natural-compare": "^1.4.0",
5858
"semver": "^7.3.2",
59-
"vue-eslint-parser": "^7.5.0"
59+
"vue-eslint-parser": "^7.6.0"
6060
},
6161
"devDependencies": {
6262
"@types/eslint": "^7.2.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--{}-->
2+
<template>
3+
<div>
4+
<p>
5+
<Address
6+
value=""
7+
onchange="await setTokenAddress(event.target.value)"/>
8+
</p>
9+
</div>
10+
</template>
11+
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1403 -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--{}-->
2+
<template>
3+
<div>
4+
<Input>
5+
<template #suffix>
6+
<Icon name="user"></Icon>
7+
</template>
8+
</Input>
9+
</div>
10+
</template>
11+
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1292 -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--{}-->
2+
<template>
3+
<Input>
4+
<template #prepend>
5+
<p class="abc" v-if="true">123</p>
6+
</template>
7+
</Input>
8+
</template>
9+
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1300 -->

tests/lib/rules/html-end-tags.js

+16
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ tester.run('html-end-tags', rule, {
6666
{
6767
filename: 'test.vue',
6868
code: '<template><div><svg><![CDATA[test</svg></div></template>'
69+
},
70+
71+
// https://github.com/vuejs/eslint-plugin-vue/issues/1403
72+
{
73+
code: `
74+
<template>
75+
<div>
76+
<p>
77+
<Address
78+
value=""
79+
onchange="await setTokenAddress(event.target.value)"/>
80+
</p>
81+
</div>
82+
</template>
83+
`,
84+
filename: 'test.vue'
6985
}
7086
],
7187
invalid: [

tests/lib/rules/html-self-closing.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,23 @@ tester.run('html-self-closing', rule, {
7070

7171
// Invalid EOF
7272
'<template><div a=">test</div></template>',
73-
'<template><div><!--test</div></template>'
73+
'<template><div><!--test</div></template>',
74+
75+
// https://github.com/vuejs/eslint-plugin-vue/issues/1403
76+
{
77+
code: `
78+
<template>
79+
<div>
80+
<p>
81+
<Address
82+
value=""
83+
onchange="await setTokenAddress(event.target.value)"/>
84+
</p>
85+
</div>
86+
</template>
87+
`,
88+
filename: 'test.vue'
89+
}
7490

7591
// other cases are in `invalid` tests.
7692
],

tests/lib/rules/no-multiple-template-root.js

+18
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ ruleTester.run('no-multiple-template-root', rule, {
5656
filename: 'test.vue',
5757
code:
5858
'<template><div v-if="foo"></div><div v-else-if="bar"></div></template>'
59+
},
60+
61+
// https://github.com/vuejs/eslint-plugin-vue/issues/1439
62+
{
63+
code: `
64+
<template>
65+
<Link :to="to" class="flex items-center">
66+
<span v-if="prefixIcon || $slots.prefix" class="mr-1">
67+
<slot name="prefix">
68+
<FontAwesomeIcon v-if="prefixIcon" :icon="prefixIcon" fixedWidth />
69+
</slot>
70+
</span>
71+
72+
<slot />
73+
</Link>
74+
</template>
75+
`,
76+
filename: 'test.vue'
5977
}
6078
],
6179
invalid: [

tests/lib/rules/no-parsing-error.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,23 @@ tester.run('no-parsing-error', rule, {
211211
},
212212
'<template><div/></template>',
213213
'<template><div v-show="">hello</div></template>',
214-
'<template><div>{{ }}</div></template>'
214+
'<template><div>{{ }}</div></template>',
215+
216+
// https://github.com/vuejs/eslint-plugin-vue/issues/1403
217+
{
218+
code: `
219+
<template>
220+
<div>
221+
<p>
222+
<Address
223+
value=""
224+
onchange="await setTokenAddress(event.target.value)"/>
225+
</p>
226+
</div>
227+
</template>
228+
`,
229+
filename: 'test.vue'
230+
}
215231
],
216232
invalid: [
217233
{

0 commit comments

Comments
 (0)