Skip to content

Empty :key + v-for breaks eslint vue #37

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
HerringtonDarkholme opened this issue Jun 20, 2017 · 2 comments
Closed

Empty :key + v-for breaks eslint vue #37

HerringtonDarkholme opened this issue Jun 20, 2017 · 2 comments

Comments

@HerringtonDarkholme
Copy link
Member

Version:
eslint-plugin-vue 3.1.1
eslint: 4.0.0

Minimal template:

<template>
    <div v-for="(item, index) in suggestions" :key></div>
</template>

Expect:
report v-bind directive needs an attribute value.

Actual:
crash.

Cannot read property 'references' of null
TypeError: Cannot read property 'references' of null
    at isUsingIterationVar (node_modules/eslint-plugin-vue/lib/rules/no-invalid-v-for.js:24:32)
    at EventEmitter.VAttribute[directive=true][key.name='for'] (node_modules/eslint-plugin-vue/lib/rules/no-invalid-v-for.js:54:32)
    at emitOne (events.js:120:20)
    at EventEmitter.emit (events.js:210:7)
    at NodeEventGenerator.applySelector (node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (node_modules/eslint/lib/util/node-event-generator.js:294:22)
    at NodeEventGenerator.enterNode (node_modules/eslint/lib/util/node-event-generator.js:308:14)
    at traverse (node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/lib/traverse-nodes.js:137:15)
    at traverse (node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/lib/traverse-nodes.js:146:21)
    at traverse (node_modules/eslint-plugin-vue/node_modules/vue-eslint-parser/lib/traverse-nodes.js:151:13)
@mysticatea
Copy link
Member

Thank you for the report.

I confirmed it.

@michalsnik
Copy link
Member

Released as v3.1.2 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants