Skip to content
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

Add new vue/no-arrow-functions-in-watch rule #1155

Merged

Conversation

sosukesuzuki
Copy link
Contributor

Fixes #1113

If this rules should be categorized please let me know

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

I have some requests.

'e.f': function (val, oldVal) { /* ... */ }
}
}`,
errors: ['You should not use an arrow function to define a watcher.']
Copy link
Member

Choose a reason for hiding this comment

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

Could you check the location with some test cases?

Suggested change
errors: ['You should not use an arrow function to define a watcher.']
errors: [
{
message: 'You should not use an arrow function to define a watcher.',
line: ?
}
]

return
}
for (const property of watchValue.properties) {
if (property.value.type === 'ArrowFunctionExpression') {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for your quick response! Looks good to me!

@ota-meshi ota-meshi merged commit f8b3014 into vuejs:master May 23, 2020
@sosukesuzuki sosukesuzuki deleted the feature/no-arrow-functions-in-watch branch May 24, 2020 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule proposal: no-arrow-functions-in-watch
2 participants