{"id":42277,"library":"vue-tsgo","title":"vue-tsgo","description":"vue-tsgo is a type checker for Vue Single File Components (SFCs) that integrates with the TypeScript 7 native preview. Designed for Node.js >= 22.12.0, it leverages the @typescript/native-preview package to provide fast and accurate type checking directly on Vue SFC files. Unlike traditional setup where type checking is offloaded to editors or build tools, vue-tsgo runs as a standalone CLI or programmatic API. Version 0.2.2 is the current stable release; the project is in early development with potential breaking changes as TypeScript 7 evolves. It differentiates by focusing solely on SFC type checking without transpilation, making it ideal for CI pipelines and pre-commit hooks.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install vue-tsgo","lang":"bash","label":"npm"},{"cmd":"yarn add vue-tsgo","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-tsgo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for TypeScript 7 native preview features. It provides the TypeScript engine for type checking.","package":"@typescript/native-preview","optional":false}],"imports":[{"note":"ESM only; CommonJS require is not supported. checkSFC is the main function exported from the package root.","wrong":"import { checkSFC } from 'vue-tsgo/check'","symbol":"checkSFC","correct":"import { checkSFC } from 'vue-tsgo'"},{"note":"VueTsgoOptions is a TypeScript type, so use type import to avoid runtime overhead.","wrong":"import { VueTsgoOptions } from 'vue-tsgo'","symbol":"VueTsgoOptions","correct":"import type { VueTsgoOptions } from 'vue-tsgo'"},{"note":"The package provides a default export of the VueTsgo class for programmatic use. CJS require is not supported.","wrong":"const VueTsgo = require('vue-tsgo')","symbol":"default (the class)","correct":"import VueTsgo from 'vue-tsgo'"}],"quickstart":{"code":"import { checkSFC } from 'vue-tsgo';\n\nasync function main() {\n  const result = await checkSFC('path/to/component.vue', {\n    typescript: {\n      strict: true,\n    },\n  });\n\n  if (result.errors.length > 0) {\n    console.error('Type errors found:');\n    for (const err of result.errors) {\n      console.error(err.message);\n    }\n    process.exit(1);\n  } else {\n    console.log('No type errors.');\n  }\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Shows how to use checkSFC to type-check a Vue SFC file, handling errors for exit codes."},"warnings":[{"fix":"Upgrade Node.js to version 22.12.0 or later.","message":"Requires Node.js >= 22.12.0 for native TypeScript support.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Run npm install @typescript/native-preview to satisfy the peer dependency.","message":"Peer dependency on @typescript/native-preview must be installed separately.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Replace 'tsconfig' with 'typescript.config' in the options object.","message":"Options object structure changed in v0.2.0; previous 'tsconfig' option is now 'typescript.config'.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use ESM import syntax (import { checkSFC } from 'vue-tsgo') or enable ESM in your project.","message":"The checkSFC function does not support CommonJS imports; using require() will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Be aware of potential inconsistencies; verify with other type checkers if needed.","message":"TypeScript 7 is still in preview; type checking results may differ from stable TypeScript versions.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.2.2':71 '22.12.0':28 '7':22,89 'accur':38 'api':69 'break':85 'build':57 'chang':86 'check':40,51,99 'checker':10 'ci':106 'cli':66 'commit':111 'compon':15 'current':74 'design':25 'develop':82 'differenti':92 'direct':41 'earli':81 'editor':55 'evolv':90 'fast':36 'file':14,45 'focus':94 'hook':112 'ideal':104 'integr':18 'javascript':113 'leverag':30 'make':102 'nativ':23 'node.js':27 'offload':53 'packag':33 'pipelin':107 'potenti':84 'pre':110 'pre-commit':109 'preview':24 'programmat':68 'project':78 'provid':35 'releas':76 'run':62 'setup':48 'sfc':44,97 'sfcs':16 'singl':13 'sole':95 'stabl':75 'standalon':65 'tool':58 'tradit':47 'transpil':101 'tsgo':3,6,61 'type':9,39,50,98 'typescript':21,88,114 'typescript/native-preview':32 'unlik':46 'version':70 'vue':2,5,12,43,60 'vue-tsgo':1,4,59 'without':100","created_at":"2026-06-04T18:56:28.922861+00:00","updated_at":"2026-06-04T18:56:28.922861+00:00","problems":[{"fix":"Use import statement or set { type: 'module' } in your package.json.","cause":"Trying to require() an ES Module with CommonJS require.","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/node_modules/vue-tsgo/index.js from /path/to/your/file.js not supported."},{"fix":"Install the peer dependency: npm install @typescript/native-preview","cause":"Missing peer dependency @typescript/native-preview.","error":"Cannot find module '@typescript/native-preview'"},{"fix":"Upgrade Node.js to version 22.12.0 or higher.","cause":"Node.js version is too old (< 22.12.0).","error":"Error: Unsupported Node.js version. vue-tsgo requires Node.js >= 22.12.0."},{"fix":"Use import { checkSFC } from 'vue-tsgo' instead of import vueTsgo from 'vue-tsgo'.","cause":"Incorrect import (perhaps using default import for named export).","error":"TypeError: checkSFC is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"vue-tsgo","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}