Skip to content

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.

  • 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 in useState or 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 the VITE_ prefix, or put a value in Nuxt's runtimeConfig.public, only if it may be public. (specific/vue)
  • VUE-1 (8) Never mutate props, including nested properties of object props: emit an event so that the parent changes its own state, or use defineModel() 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 with computed, 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 as defineProps<Props>(), and type-check .vue files in CI with vue-tsc. (specific/vue) Automatable: eslint-plugin-vue, vue-tsc.
  • VUE-7 (7) Use Pinia for state that many components share, instead of hand-rolled global reactive() objects. (specific/vue)
  • VUE-8 (7) In Nuxt, load the data a page renders with useFetch or useAsyncData, keep $fetch for requests that user events trigger, and use pick or transform to 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 with routeRules. (specific/vue)
  • VUE-11 (7) Lazy-load route components with dynamic imports. (specific/vue)
  • VUE-5 (6) Extract reusable stateful logic into composables: name them useX, accept refs or getters and read them with toValue(), return a plain object of refs, and call them synchronously in <script setup> or setup(). (specific/vue)
  • VUE-9 (6) Render the same output on the server and in the browser: use SSR-safe composables, keep browser-only code in onMounted() 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 with tabindex="-1" at the top of App.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)