Index of every page on this site: llms.txt
All skills
jyasuu avatar

/vue-best-practices

@d3e2684
Run it yourself

Vue 3 and Vue.js best practices for TypeScript, vue-tsc, and Volar. This skill should be used when writing, reviewing, or refactoring Vue components to ensure correct typing patterns. Triggers on tasks involving Vue components, props extraction, wrapper components, template type checking, or Volar configuration.

  • 18 files
  • 39.7 KB
  • MIT
  • Updated 10 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/jyasuu/cheat-sheet/vue-best-practices

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

rulesmodule-resolution-bundler.md

≈550 tokens on demand. Your agent reads this file only when SKILL.md points to it.

moduleResolution Bundler Migration Issues

Impact: HIGH - fixes "Cannot find module" errors after @vue/tsconfig upgrade

Recent versions of @vue/tsconfig changed moduleResolution from "node" to "bundler". This can break existing projects with errors like "Cannot find module 'vue'" or issues with resolveJsonModule.

Symptoms

  • Cannot find module 'vue' or other packages
  • Option '--resolveJsonModule' cannot be specified without 'node' module resolution
  • Errors appear after updating @vue/tsconfig
  • Some third-party packages no longer resolve

Root Cause

moduleResolution: "bundler" requires:

  1. TypeScript 5.0+
  2. Packages to have proper exports field in package.json
  3. Different resolution rules than Node.js classic resolution

Fix

Option 1: Ensure TypeScript 5.0+ everywhere

npm install -D typescript@^5.0.0

In monorepos, ALL packages must use TypeScript 5.0+.

Option 2: Add compatibility workaround

{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "resolvePackageJsonExports": false
  }
}

Setting resolvePackageJsonExports: false restores compatibility with packages that don't have proper exports.

Option 3: Revert to Node resolution

{
  "compilerOptions": {
    "moduleResolution": "node"
  }
}

Which Packages Break?

Packages break if they:

  • Lack exports field in package.json
  • Have incorrect exports configuration
  • Rely on Node.js-specific resolution behavior

Diagnosis

# Check which resolution is being used
cat tsconfig.json | grep moduleResolution

# Test if a specific module resolves
npx tsc --traceResolution 2>&1 | grep "module-name"

Reference

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at d3e2684. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 10 months ago
metadata
{
  "author": "hyf0",
  "version": "8.0.0"
}

README badge

README badge for jyasuu/cheat-sheet/vue-best-practices