You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe what the rule should do:
Since Vue v2.1.0, Vue.nextTick and vm.$nextTick return 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.
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:
Please describe what the rule should do:
Since Vue v2.1.0,
Vue.nextTick
andvm.$nextTick
return 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
await
or.then()
style is out of scope for this plugin, there is already theeslint-plugin-promise
plugin with thepromise/prefer-await-to-then
rule.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:
The text was updated successfully, but these errors were encountered: