Vapor rules
Template and script constraints for components compiled in Vapor mode.
Each rule page shows a failing example, a passing example, and the configuration that turns the rule on.
Default (1)
Added by happy-path, the default preset.
| Rule | What it checks | Auto-fix |
|---|---|---|
vapor/no-vue-lifecycle-events |
Disallow @vue:xxx per-element lifecycle events (not supported in Vapor). |
Stricter presets (5)
Only in opinionated, nuxt or ecosystem. The Presets column lists which.
| Rule | What it checks | Presets | Auto-fix |
|---|---|---|---|
script/no-get-current-instance |
Disallow getCurrentInstance() in Vapor mode (returns null). | opinionated |
|
script/no-options-api |
Disallow Options API patterns in Vapor mode. | opinionated |
|
vapor/no-inline-template |
Disallow deprecated inline-template attribute. | nuxt, opinionated |
|
vapor/prefer-static-class |
Prefer static class over dynamic class binding for string literals. | nuxt, opinionated |
✓ |
vapor/require-vapor-attribute |
Suggest adding vapor attribute to script setup. | nuxt, opinionated |
Opt-in (1)
Not in any preset. Turn them on by name in the linter.rules passed to withVue.
| Rule | What it checks | Auto-fix |
|---|---|---|
script/no-next-tick |
Disallow nextTick() usage in Vapor-oriented components. |