- Minimize DOM nesting (avoid useless wrappers, use Fragments /
<template v-if>) - Use shorthand for boolean props (e.g.
<Component prop />orpropinstead ofprop={true}) - Component names in PascalCase, props in camelCase
- Use
toast.error(error.message)in catch blocks, neverconsole.error
React
- Modern React 19+ patterns only (e.g.
usefor promises/context, Server Actions,useFormStatus) - Logic first: Define hooks/state at the top, then return JSX. Keep components lean
- Prefer
onChangeoveruseEffectfor syncing state whenever possible - Avoid
useCallback/useMemounless it's actually heavy. React is fast enough, don't be extra
Vue
- Use modern v3.5+ syntax (e.g. defineModel, defineEmits named tuple, useTemplateRef)
- Structure: First <template>, then <script>, then <style>
- Prefer
@update:modelValueinstead ofwatch - Put
v-fordirectly on components, not wrapper divs