1---2name: vue-best-practices-23description: Vue 3 TypeScript, vue-tsc, Volar, Vite, component props, testing, composition API.4license: MIT5---6
7# Vue Best Practices
8
9## Capability Rules
10
11| Rule | Keywords | Description |
12|------|----------|-------------|
13| [vue-tsc-strict-templates](rules/vue-tsc-strict-templates.md) | undefined component, template error, strictTemplates | Catch undefined components in templates |
14| [fallthrough-attributes](rules/fallthrough-attributes.md) | fallthrough, $attrs, wrapper component | Type-check fallthrough attributes |
15| [strict-css-modules](rules/strict-css-modules.md) | css modules, $style, typo | Catch CSS module class typos |
16| [data-attributes-config](rules/data-attributes-config.md) | data-*, strictTemplates, attribute | Allow data-* attributes |
17| [volar-3-breaking-changes](rules/volar-3-breaking-changes.md) | volar, vue-language-server, editor | Fix Volar 3.0 upgrade issues |
18| [module-resolution-bundler](rules/module-resolution-bundler.md) | cannot find module, @vue/tsconfig, moduleResolution | Fix module resolution errors |
19| [unplugin-auto-import-conflicts](rules/unplugin-auto-import-conflicts.md) | unplugin, auto-import, types any | Fix unplugin type conflicts |
20| [codeactions-save-performance](rules/codeactions-save-performance.md) | slow save, vscode, performance | Fix slow save in large projects |
21| [duplicate-plugin-detection](rules/duplicate-plugin-detection.md) | duplicate plugin, vite, vue plugin | Detect duplicate plugins |
22| [define-model-update-event](rules/define-model-update-event.md) | defineModel, update event, undefined | Fix model update errors |
23| [with-defaults-union-types](rules/with-defaults-union-types.md) | withDefaults, union type, default | Fix union type defaults |
24| [deep-watch-numeric](rules/deep-watch-numeric.md) | watch, deep, array, Vue 3.5 | Efficient array watching |
25| [vue-directive-comments](rules/vue-directive-comments.md) | @vue-ignore, @vue-skip, template | Control template type checking |
26| [script-setup-jsdoc](rules/script-setup-jsdoc.md) | jsdoc, script setup, documentation | Add JSDoc to script setup |
27| [vue-router-typed-params](rules/vue-router-typed-params.md) | route params, typed router, unplugin | Fix route params typing |
28
29## Efficiency Rules
30
31| Rule | Keywords | Description |
32|------|----------|-------------|
33| [hmr-vue-ssr](rules/hmr-vue-ssr.md) | hmr, ssr, hot reload | Fix HMR in SSR apps |
34| [pinia-store-mocking](rules/pinia-store-mocking.md) | pinia, mock, vitest, store | Mock Pinia stores |
35
36## Reference
37
38- [Vue Language Tools](https://github.com/vuejs/language-tools)
39- [Vue 3 Documentation](https://vuejs.org/)
40
41
42---
43## 📦 可用资源
44
45- `skill://vue-best-practices/rules/codeactions-save-performance.md`
46- `skill://vue-best-practices/rules/data-attributes-config.md`
47- `skill://vue-best-practices/rules/deep-watch-numeric.md`
48- `skill://vue-best-practices/rules/define-model-update-event.md`
49- `skill://vue-best-practices/rules/duplicate-plugin-detection.md`
50- `skill://vue-best-practices/rules/fallthrough-attributes.md`
51- `skill://vue-best-practices/rules/hmr-vue-ssr.md`
52- `skill://vue-best-practices/rules/module-resolution-bundler.md`
53- `skill://vue-best-practices/rules/pinia-store-mocking.md`
54- `skill://vue-best-practices/rules/script-setup-jsdoc.md`
55- `skill://vue-best-practices/rules/strict-css-modules.md`
56- `skill://vue-best-practices/rules/unplugin-auto-import-conflicts.md`
57- `skill://vue-best-practices/rules/volar-3-breaking-changes.md`
58- `skill://vue-best-practices/rules/vue-directive-comments.md`
59- `skill://vue-best-practices/rules/vue-router-typed-params.md`
60- `skill://vue-best-practices/rules/vue-tsc-strict-templates.md`
61- `skill://vue-best-practices/rules/with-defaults-union-types.md`
62
63> 根据 SKILL.md 中的 IF-THEN 规则判断是否需要加载