Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
Please describe what the rule should do:
Since Vue v2.1.0,
Vue.nextTickandvm.$nextTickreturn a Promise if no callback is provided. So both of the following are valid:Vue.nextTick(callback)Vue.nextTick().then()/await Vue.nextTick()Or inside components:
this.$nextTick(callback)this.$nextTick().then()/await this.$nextTick()There should be a rule that enforces one of the styles to make the codebase more consistent. I suggest that the Promise-style is the default of this rule, because it makes the code more concise and is generally well supported as of now.
However, enforcing the
awaitor.then()style is out of scope for this plugin, there is already theeslint-plugin-promiseplugin with thepromise/prefer-await-to-thenrule.What category should the rule belong to?
[X] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about: