Skip to content

Fixed no-side-effects-in-computed-properties when el is object #1226

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

Merged

Conversation

ktmouk
Copy link
Contributor

@ktmouk ktmouk commented Jun 30, 2020

Hi, thanks for great plugin!

I'm using object property to set el of Vue.
However, I get a TypeError when I update eslint-plugin-vue to v7.0.0-alpha.7 and run eslint.

for example:

const dummy = { app: '#app' }

new Vue({
  el: dummy.app,
  template: '<p>test</p>',
});
TypeError: Cannot read property 'body' of undefined

I think the cause of this issue is that the scopeStack has no default value.
but, I’m not sure if this PR is the best solution.

Could you please review this PR or use another best solution to fix this issue?
Thanks.

*/
let scopeStack

/** @type { { upper: any, body: null | BlockStatement | Expression } } */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I referred to

/** @type { { upper: any, body: null | BlockStatement | Expression, returnTypes?: null | ReturnType[] } } */

@ota-meshi ota-meshi merged commit 2e75ba6 into vuejs:master Jun 30, 2020
@ota-meshi
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants