Skip to content

Commit

Permalink
Upgrade vue-eslint-parser to 7.6.0 (#1448)
Browse files Browse the repository at this point in the history
close #1292
close #1300
close #1439
  • Loading branch information
ota-meshi committed Mar 2, 2021
1 parent 467ef96 commit 3878fc4
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -56,7 +56,7 @@
"eslint-utils": "^2.1.0",
"natural-compare": "^1.4.0",
"semver": "^7.3.2",
"vue-eslint-parser": "^7.5.0"
"vue-eslint-parser": "^7.6.0"
},
"devDependencies": {
"@types/eslint": "^7.2.0",
Expand Down
11 changes: 11 additions & 0 deletions tests/fixtures/html-indent/address-component-01.vue
@@ -0,0 +1,11 @@
<!--{}-->
<template>
<div>
<p>
<Address
value=""
onchange="await setTokenAddress(event.target.value)"/>
</p>
</div>
</template>
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1403 -->
11 changes: 11 additions & 0 deletions tests/fixtures/html-indent/input-component-01.vue
@@ -0,0 +1,11 @@
<!--{}-->
<template>
<div>
<Input>
<template #suffix>
<Icon name="user"></Icon>
</template>
</Input>
</div>
</template>
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1292 -->
9 changes: 9 additions & 0 deletions tests/fixtures/html-indent/input-component-02.vue
@@ -0,0 +1,9 @@
<!--{}-->
<template>
<Input>
<template #prepend>
<p class="abc" v-if="true">123</p>
</template>
</Input>
</template>
<!-- https://github.com/vuejs/eslint-plugin-vue/issues/1300 -->
16 changes: 16 additions & 0 deletions tests/lib/rules/html-end-tags.js
Expand Up @@ -66,6 +66,22 @@ tester.run('html-end-tags', rule, {
{
filename: 'test.vue',
code: '<template><div><svg><![CDATA[test</svg></div></template>'
},

// https://github.com/vuejs/eslint-plugin-vue/issues/1403
{
code: `
<template>
<div>
<p>
<Address
value=""
onchange="await setTokenAddress(event.target.value)"/>
</p>
</div>
</template>
`,
filename: 'test.vue'
}
],
invalid: [
Expand Down
18 changes: 17 additions & 1 deletion tests/lib/rules/html-self-closing.js
Expand Up @@ -70,7 +70,23 @@ tester.run('html-self-closing', rule, {

// Invalid EOF
'<template><div a=">test</div></template>',
'<template><div><!--test</div></template>'
'<template><div><!--test</div></template>',

// https://github.com/vuejs/eslint-plugin-vue/issues/1403
{
code: `
<template>
<div>
<p>
<Address
value=""
onchange="await setTokenAddress(event.target.value)"/>
</p>
</div>
</template>
`,
filename: 'test.vue'
}

// other cases are in `invalid` tests.
],
Expand Down
18 changes: 18 additions & 0 deletions tests/lib/rules/no-multiple-template-root.js
Expand Up @@ -56,6 +56,24 @@ ruleTester.run('no-multiple-template-root', rule, {
filename: 'test.vue',
code:
'<template><div v-if="foo"></div><div v-else-if="bar"></div></template>'
},

// https://github.com/vuejs/eslint-plugin-vue/issues/1439
{
code: `
<template>
<Link :to="to" class="flex items-center">
<span v-if="prefixIcon || $slots.prefix" class="mr-1">
<slot name="prefix">
<FontAwesomeIcon v-if="prefixIcon" :icon="prefixIcon" fixedWidth />
</slot>
</span>
<slot />
</Link>
</template>
`,
filename: 'test.vue'
}
],
invalid: [
Expand Down
18 changes: 17 additions & 1 deletion tests/lib/rules/no-parsing-error.js
Expand Up @@ -211,7 +211,23 @@ tester.run('no-parsing-error', rule, {
},
'<template><div/></template>',
'<template><div v-show="">hello</div></template>',
'<template><div>{{ }}</div></template>'
'<template><div>{{ }}</div></template>',

// https://github.com/vuejs/eslint-plugin-vue/issues/1403
{
code: `
<template>
<div>
<p>
<Address
value=""
onchange="await setTokenAddress(event.target.value)"/>
</p>
</div>
</template>
`,
filename: 'test.vue'
}
],
invalid: [
{
Expand Down

0 comments on commit 3878fc4

Please sign in to comment.