Cross-file rules
Checks that need more than one file: a parent and its children, a provider and its injectors, or a router and its links.
Turn these checks on with crossFile: true in the linter passed to withVue, or run vize lint --cross-file. Diagnostics are shown as vize:croquis/cf/<name>; configure them in linter.rules as croquis/cf/<name>, without vize:.
Each rule page shows a failing example, a passing example, and the configuration that turns the rule on.
| Rule | What it checks | Status |
|---|---|---|
ecosystem/vue-router-extra-param |
Reports navigation params that the target route does not declare. | Reported by vp run lint |
ecosystem/vue-router-missing-param |
Reports a named navigation that omits a required route param. | Reported by vp run lint |
ecosystem/vue-router-param-type |
Reports a route param value the declared segment does not accept. | Reported by vp run lint |
ecosystem/vue-router-unknown-route |
Reports a navigation name that the installed router does not declare. | Reported by vp run lint |
html/cross-component-nesting |
Check actual HTML nesting after imported components are composed. | Reported by vp run lint |
vize:croquis/cf/array-mutation |
Use observable mutations for array index updates in Vue 2.7. | Planned; not reported yet |
vize:croquis/cf/async-boundary |
Reactive state crosses an async boundary and can be observed stale. | Reported by vp run lint |
vize:croquis/cf/async-no-suspense |
An async component is rendered without a Suspense boundary. | Experimental; not reported by the CLI yet |
vize:croquis/cf/browser-api-ssr |
A browser-only API is used where the component can render on the server. | Reported by vp run lint |
vize:croquis/cf/circular-dep |
Components import each other in a cycle. | Planned; not reported yet |
vize:croquis/cf/circular-reactive-dependency |
Reactive computations depend on each other in a cycle. | Reported by vp run lint |
vize:croquis/cf/closure-captures-reactive |
A closure captures a reactive value and will not see later updates. | Planned; not reported yet |
vize:croquis/cf/composable-outside-setup |
A composable is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/computed-side-effects |
A computed getter writes state or performs another side effect. | Planned; not reported yet |
vize:croquis/cf/deep-import |
An import chain is deeper than the project allows. | Planned; not reported yet |
vize:croquis/cf/destructuring-breaks-reactivity |
Destructuring a reactive object copies the fields and drops tracking. | Reported by vp run lint |
vize:croquis/cf/di-outside-setup |
provide or inject is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/dom-access-without-next-tick |
The DOM is read before Vue has flushed the update. | Planned; not reported yet |
vize:croquis/cf/duplicate-id |
The same element id is used in more than one component. | Reported by vp run lint |
vize:croquis/cf/event-listener-leak |
An event listener is registered and never removed. | Planned; not reported yet |
vize:croquis/cf/event-modifier |
An event listener uses a modifier the emit does not support. | Experimental; not reported by the CLI yet |
vize:croquis/cf/hydration-risk |
The render can disagree between the server and the client. | Reported by vp run lint |
vize:croquis/cf/inherit-attrs-unused |
inheritAttrs: false is set and the component never reads the attributes. |
Experimental; not reported by the CLI yet |
vize:croquis/cf/inject-without-symbol |
inject uses a plain key instead of an InjectionKey symbol. |
Reported by vp run lint |
vize:croquis/cf/injected-async-mutation-race |
An injected value is mutated from an async task that can race. | Reported by vp run lint |
vize:croquis/cf/lifecycle-outside-setup |
A lifecycle hook is registered outside setup. |
Planned; not reported yet |
vize:croquis/cf/lifecycle-without-cleanup |
A lifecycle hook starts work and never cleans it up. | Experimental; not reported by the CLI yet |
vize:croquis/cf/missing-required-prop |
A required prop is not passed. | Experimental; not reported by the CLI yet |
vize:croquis/cf/missing-suspense |
An async dependency is used outside a Suspense boundary. | Planned; not reported yet |
vize:croquis/cf/module-scope-reactive |
Reactive state is created at module scope and shared by every caller. | Planned; not reported yet |
vize:croquis/cf/multi-root-attrs |
A multi-root component receives attributes and has nowhere to put them. | Experimental; not reported by the CLI yet |
vize:croquis/cf/mutated-after-escape |
A reactive object is mutated after it has escaped its owner. | Planned; not reported yet |
vize:croquis/cf/non-reactive-provide |
A provided value is not reactive, so descendants will not see updates. | Reported by vp run lint |
vize:croquis/cf/non-unique-id |
An element id inside a loop is not unique per item. | Reported by vp run lint |
vize:croquis/cf/object-identity-comparison |
Compare stable record IDs across raw objects and reactive proxies. | Planned; not reported yet |
vize:croquis/cf/pinia-getter |
Avoid setup-time snapshots of Pinia getter values. | Planned; not reported yet |
vize:croquis/cf/prop-type-mismatch |
A passed prop value does not match the declared type. | Experimental; not reported by the CLI yet |
vize:croquis/cf/provide-inject-type |
A provided value and its inject do not have the same type. | Reported by vp run lint |
vize:croquis/cf/provide-without-symbol |
provide uses a plain key instead of an InjectionKey symbol. |
Reported by vp run lint |
vize:croquis/cf/reactive-export |
Reactive state is exported from the module. | Planned; not reported yet |
vize:croquis/cf/reactivity-outside-setup |
A reactive API is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/reassignment-breaks-reactivity |
Reassigning a reactive binding replaces it with a plain value. | Reported by vp run lint |
vize:croquis/cf/reference-escapes-scope |
A reactive reference escapes the scope that owns its lifetime. | Planned; not reported yet |
vize:croquis/cf/setup-context-violation |
Keep component-owned reactive state inside per-instance setup. | Experimental; not reported by the CLI yet |
vize:croquis/cf/shallow-deep-access |
A deep property of a shallowReactive or shallowRef value is read as if it were tracked. |
Planned; not reported yet |
vize:croquis/cf/spread-breaks-reactivity |
Spreading a reactive object copies its values and drops the tracking. | Reported by vp run lint |
vize:croquis/cf/suspense-no-fallback |
<Suspense> has no fallback content. |
Planned; not reported yet |
vize:croquis/cf/template-ref-timing |
A template ref is read before the component is mounted. | Planned; not reported yet |
vize:croquis/cf/toraw-mutation |
toRaw is used and the raw object is then mutated. |
Planned; not reported yet |
vize:croquis/cf/uncaught-error |
A component can throw and no error boundary catches it. | Reported by vp run lint |
vize:croquis/cf/undeclared-emit |
The component emits an event that is not declared. | Experimental; not reported by the CLI yet |
vize:croquis/cf/undeclared-prop |
A parent passes a prop the child does not declare. | Experimental; not reported by the CLI yet |
vize:croquis/cf/undefined-slot |
A parent fills a slot the child does not expose. | Planned; not reported yet |
vize:croquis/cf/unhandled-event |
A child emits an event that no parent handles. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unmatched-inject |
inject names a key that no ancestor provides. |
Reported by vp run lint |
vize:croquis/cf/unmatched-listener |
A parent listens for an event the child does not emit. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unregistered-component |
A template uses a component that is not registered or imported. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unresolved-import |
An import does not resolve to a module. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-attrs |
Fallthrough attributes are passed to a multi-root component that does not use them. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-emit |
A declared emit is never used. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-provide |
A provided key is never injected. | Reported by vp run lint |
vize:croquis/cf/value-extraction-breaks-reactivity |
Reading a reactive value out into a local drops later updates. | Reported by vp run lint |
vize:croquis/cf/watch-can-be-computed |
A watcher only copies a value into state and can be a computed. | Planned; not reported yet |
vize:croquis/cf/watcheffect-async |
Guard async watchEffect work against invalidation and stale responses. | Reported by vp run lint |
vize:croquis/cf/watcher-outside-setup |
watch or watchEffect is called outside setup. |
Planned; not reported yet |
vue/cross-file-attrs-fallthrough |
A parent passes attributes to a resolved child whose root cannot inherit them and does not explicitly use $attrs. | Reported by vp run lint |