Skip to content

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

Merged
ota-meshi merged 3 commits into
vuejs:masterfrom
sosukesuzuki:feature/no-arrow-functions-in-watch
May 23, 2020
Merged

Add new vue/no-arrow-functions-in-watch rule#1155
ota-meshi merged 3 commits into
vuejs:masterfrom
sosukesuzuki:feature/no-arrow-functions-in-watch

Conversation

@sosukesuzuki

Copy link
Copy Markdown
Contributor

Fixes #1113

If this rules should be categorized please let me know

@ota-meshi ota-meshi left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ota-meshi ota-meshi left a comment

Copy link
Copy Markdown
Member

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