Compilation Conventions
This page contains mandatory specifications. Non-compliance may result in compilation outputs that violate React Hook rules.
A. File and Entry Conventions
- It is recommended to include only controllable directories in
input. - It is strongly recommended to add Vue entry files (e.g.,
src/main.ts) toexclude. - Validate with small directories first, then expand the scope.
B. Script Conventions
- Prioritize the use of
<script setup>. defineProps/defineEmits/defineSlots/defineOptionsare only allowed to be used at the top level.use*calls that will be converted to React Hooks must be placed at the top level; calling them inside conditions, loops, or nested functions is prohibited.
C. Template Conventions
- Only use supported directives; unknown directives will trigger warnings.
v-else/v-else-ifmust immediately follow the previous conditional branch.- Child nodes of
Transitionneed to meet constraints (single node or derivable conditional branches).
D. Style Conventions
- Only the first
styleblock is supported; multiplestyleblocks will trigger warnings. scopedandmoduleare supported but must be used in accordance with specifications.- Avoid relying on complex global style side effects.
E. Routing Conventions
- Minor manual adaptation is required when using routing.
- See Router Adaptation.
F. Experimental Version Notice
The current version is intended for controllable projects and does not guarantee one-time, non-intrusive migration of complex legacy projects.
