useVueNextTickPromise
Summary
Section titled “Summary”- Rule available since:
v2.4.15 - Diagnostic Category:
lint/nursery/useVueNextTickPromise - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Inspired from
vue/next-tick-style
- Inspired from
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueNextTickPromise": "error" } } }}Description
Section titled “Description”Enforces Promise syntax when using Vue nextTick.
Vue nextTick returns a Promise when no callback is passed. Promise syntax composes better with await and keeps asynchronous control flow explicit.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<script>import { nextTick } from "vue";
nextTick(() => { // ...});</script>code-block.vue:3:1 lint/nursery/useVueNextTickPromise ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Vue `nextTick` was called with a callback.
1 │ import { nextTick } from “vue”;
2 │
> 3 │ nextTick(() => {
│ ^^^^^^^^^^^^^^^^
> 4 │ // …
> 5 │ });
│ ^^
6 │
ℹ Promise syntax composes better with `await` and keeps asynchronous control flow explicit.
ℹ Call `nextTick` without a callback, then await it or chain `.then()` instead.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
<script>import { nextTick } from "vue";
await nextTick();// ...</script>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.