Skip to content

chore(vue-eslint-parser): Update to 5.0.0 #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"eslint": "^5.0.0"
},
"dependencies": {
"vue-eslint-parser": "^4.0.2"
"vue-eslint-parser": "^5.0.0"
},
"devDependencies": {
"@types/node": "^4.2.16",
Expand Down
12 changes: 8 additions & 4 deletions tests/lib/rules/no-unused-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ tester.run('no-unused-vars', rule, {
code: '<template><ol v-for="i in data"><li v-for="f in i">{{ f.bar.baz }}</li></ol></template>'
},
{
code: '<template scope="props">{{props}}</template>'
code: '<template><template scope="props">{{props}}</template></template>'
},
{
code: '<template scope="props"><span v-if="props"></span></template>'
code: '<template><template scope="props"><span v-if="props"></span></template></template>'
},
{
code: '<template><div v-for="(item, key) in items" :key="key">{{item.name}}</div></template>'
Expand All @@ -57,11 +57,15 @@ tester.run('no-unused-vars', rule, {
errors: ["'i' is defined but never used."]
},
{
code: '<template scope="props"></template>',
code: '<template><span slot-scope="props"></span></template>',
errors: ["'props' is defined but never used."]
},
{
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{i}}</comp></template>',
code: '<template><span><template scope="props"></template></span></template>',
errors: ["'props' is defined but never used."]
},
{
code: '<template><div v-for="i in 5"><comp v-for="j in 10">{{i}}{{i}}</comp></div></template>',
errors: ["'j' is defined but never used."]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/valid-v-else-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tester.run('valid-v-else-if', rule, {
invalid: [
{
filename: 'test.vue',
code: '<template v-else-if="foo"><div></div></template>',
code: '<template><template v-else-if="foo"><div></div></template></template>',
errors: ["'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/valid-v-else.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tester.run('valid-v-else', rule, {
invalid: [
{
filename: 'test.vue',
code: '<template v-else><div></div></template>',
code: '<template><template v-else><div></div></template></template>',
errors: ["'v-else' directives require being preceded by the element which has a 'v-if' or 'v-else' directive."]
},
{
Expand Down
65 changes: 37 additions & 28 deletions tests/lib/rules/valid-v-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ tester.run('valid-v-for', rule, {
},
{
filename: 'test.vue',
code: '<template v-for="x of list"><slot name="item" /></template>'
code: '<template><template v-for="x of list"><slot name="item" /></template></template>'
},
{
filename: 'test.vue',
code: '<template v-for="x of list">foo<div></div></template>'
code: '<template><template v-for="x of list">foo<div></div></template></template>'
},
{
filename: 'test.vue',
Expand All @@ -90,22 +90,26 @@ tester.run('valid-v-for', rule, {
{
filename: 'test.vue',
code: `
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in y.zs" :key="z.id">
123
</li>
<template>
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in y.zs" :key="z.id">
123
</li>
</template>
</template>
</template>`
},
{
filename: 'test.vue',
code: `
<template v-for="x in xs">
<template v-for="y in ys">
<li v-for="z in zs" :key="x.id + y.id + z.id">
123
</li>
<template>
<template v-for="x in xs">
<template v-for="y in ys">
<li v-for="z in zs" :key="x.id + y.id + z.id">
123
</li>
</template>
</template>
</template>`
}
Expand Down Expand Up @@ -215,38 +219,43 @@ tester.run('valid-v-for', rule, {
filename: 'test.vue',
errors: ["Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."],
code: `
<template v-for="x in xs">
<template v-for="y in a.ys">
<li v-for="z in y.zs" :key="z.id">
123
</li>
<template>
<template v-for="x in xs">
<template v-for="y in a.ys">
<li v-for="z in y.zs" :key="z.id">
123
</li>
</template>
</template>
</template>`
},
{
filename: 'test.vue',
errors: ["Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."],
code: `
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in a.zs" :key="z.id">
123
</li>
<template>
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in a.zs" :key="z.id">
123
</li>
</template>
</template>
</template>`
},
{
filename: 'test.vue',
errors: ["Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."],
code: `
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in x.zs" :key="z.id">
123
</li>
<template>
<template v-for="x in xs">
<template v-for="y in x.ys">
<li v-for="z in x.zs" :key="z.id">
123
</li>
</template>
</template>
</template>`
}

]
})