Vue checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
VUE-6(9) In server-rendered apps, never keep user or request data in module-level state: create the app, router and stores for each request, and in Nuxt keep shared state inuseStateor Pinia, not in refs exported from a module. (specific/vue) -
VUE-13(9) Never use untrusted content as a Vue template, and never mount Vue on server-rendered HTML that contains user-provided content. (specific/vue) -
VUE-14(9) Give an environment variable theVITE_prefix, or put a value in Nuxt'sruntimeConfig.public, only if it may be public. (specific/vue)
Recommended (6–8)¶
-
VUE-1(8) Never mutate props, including nested properties of object props: emit an event so that the parent changes its own state, or usedefineModel()for two-way binding. (specific/vue) Automatable: eslint-plugin-vue. -
VUE-2(7) Write application components as Single-File Components with the Composition API and<script setup>. (specific/vue) Automatable: eslint-plugin-vue. -
VUE-3(7) Derive values withcomputed, keep computed getters free of side effects, and use watchers only for side effects in reaction to state changes. (specific/vue) Automatable: eslint-plugin-vue. -
VUE-4(7) Declare props and emitted events with types, such asdefineProps<Props>(), and type-check.vuefiles in CI withvue-tsc. (specific/vue) Automatable: eslint-plugin-vue, vue-tsc. -
VUE-7(7) Use Pinia for state that many components share, instead of hand-rolled globalreactive()objects. (specific/vue) -
VUE-8(7) In Nuxt, load the data a page renders withuseFetchoruseAsyncData, keep$fetchfor requests that user events trigger, and usepickortransformto keep only the fields the page renders. (specific/vue) -
VUE-10(7) Use server-side rendering or static generation, for example with Nuxt, when page load performance or SEO matters, and a client-side SPA only when they don't. In Nuxt, set the rendering mode per route withrouteRules. (specific/vue) -
VUE-11(7) Lazy-load route components with dynamic imports. (specific/vue) -
VUE-5(6) Extract reusable stateful logic into composables: name themuseX, accept refs or getters and read them withtoValue(), return a plain object of refs, and call them synchronously in<script setup>orsetup(). (specific/vue) -
VUE-9(6) Render the same output on the server and in the browser: use SSR-safe composables, keep browser-only code inonMounted()or<ClientOnly>, and don't render values that differ between the two, such as the current time. (specific/vue) -
VUE-12(6) Put an element withtabindex="-1"at the top ofApp.vue, just before a skip link to the main content, and focus it in a watcher on Vue Router's current route. (specific/vue) -
VUE-15(6) Run unit and component tests with Vitest, give each component its own component test, and in those tests interact with the component as a user would instead of mocking its child components. (specific/vue)