Registry / type-stubs / ts-vue-plugin

ts-vue-plugin

JSON →
library0.1.3jsnpmunverified

Alpha-stage TypeScript Language Service Plugin for Vue that provides TypeScript intellisense inside .vue files by parsing the script section and wrapping default exports in new Vue() for contextual typing. Version 0.1.3 (last release). It integrates with any editor supporting the TypeScript language service (VS Code, Emacs, Vim via tsuquyomi-vue). Unlike Vetur which is VS Code-specific, this plugin is editor-agnostic. It resolves .vue imports but does not support template or style sections; completions only work inside script tags.

npm install ts-vue-plugin
INSTALL
IMPORT
SIG · TS-VUE-PLUGIN
T
ts-vue-plugin
type-stubsjavascriptv0.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
Add to tsconfig.json plugins array: { "name": "ts-vue-plugin" }
const vuePlugin = require('ts-vue-plugin')
Not a regular import; it's a TypeScript language service plugin configured in tsconfig.json.
none
import Foo from 'Foo.vue'
import { Foo } from 'Foo.vue'
Default imports are resolved; named imports are not supported.
all exports
export default { ... }
module.exports = { ... }
Only ES6 export default syntax is recognized. CommonJS module.exports is not supported.

Shows configuration in tsconfig.json and an example .vue script that triggers TypeScript intellisense via the plugin.

// tsconfig.json { "compilerOptions": { "allowSyntheticDefaultImports": true, "plugins": [{ "name": "ts-vue-plugin" }] } } // Install // npm install ts-vue-plugin vue-template-compiler // In a .vue file (script section): // Only ES6 export default is supported // <script lang="ts"> export default { data() { return { message: 'Hello Vue!' } }, methods: { greet() { console.log(this.message) // TypeScript intellisense works here } } } // </script> // Import other .vue files: // import Other from './Other.vue'; // Resolves type
Debug
Known issues
gotchaOnly ES6 export default syntax is supported; CommonJS module.exports will not be recognized.
fix
Use export default { ... } syntax inside script tags.
affects: 0.1.0 - 0.1.3
gotchaOnly script sections are processed; template and style sections are completely ignored. No HTML/CSS completions.
fix
Use Vetur for full .vue file support (template+script+style).
affects: 0.1.0 - 0.1.3
gotchaOnly lang="javascript", lang="typescript", or no lang attribute trigger the language service. Other lang values (e.g., lang="coffeescript") are ignored.
fix
Ensure script tag has lang="ts" or lang="js" or no lang attribute.
affects: 0.1.0 - 0.1.3
deprecatedPackage is in alpha and has not been updated since 2017. Consider using Volar for modern Vue 3 / Vue 2 TS support.
fix
Migrate to @vue/language-server (Volar) or Vetur for VS Code users.
affects: >=0.1.0
gotchaTo use plugin outside VS Code (e.g., Emacs, Vim), you must manually configure the editor to use workspace TypeScript version.
fix
Run 'Select TypeScript version' in VS Code or set tsserver path in your editor.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'vue-template-compiler'
Missing peer dependency vue-template-compiler.
fix
Run npm install vue-template-compiler --save-dev
TypeScript plugin 'ts-vue-plugin' is not installed
Plugin is not in node_modules or tsconfig.json is misconfigured.
fix
Check that ts-vue-plugin is installed and listed correctly in compilerOptions.plugins.
Property 'message' does not exist on type '{}'
Default export not wrapped due to non-object literal syntax.
fix
Ensure you use export default { ... } with an object literal; avoid variables or function returns.
Cannot use JSX unless the '--jsx' flag is provided
Vue files inferred as TSX/JSX incorrectly.
fix
Add "allowJs": true or set "jsx": "preserve" in tsconfig.json.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
vue-template-compilerrequiredUsed to parse .vue files and extract the script section
typescriptoptionalPeer dependency, works with TypeScript language service
Agent activity
30 hits · last 30 days
node
28
OpenAI (training)
1
Resources
ts-vue-plugin — npm install ts-vue-plugin · libregistry