{"id":18870,"library":"ts-vue-plugin","title":"ts-vue-plugin","description":"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.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/HerringtonDarkholme/vue-ts-plugin","tags":["javascript","typescript","vue"],"install":[{"cmd":"npm install ts-vue-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add ts-vue-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add ts-vue-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to parse .vue files and extract the script section","package":"vue-template-compiler","optional":false},{"reason":"Peer dependency, works with TypeScript language service","package":"typescript","optional":true}],"imports":[{"note":"Not a regular import; it's a TypeScript language service plugin configured in tsconfig.json.","wrong":"const vuePlugin = require('ts-vue-plugin')","symbol":"plugin","correct":"Add to tsconfig.json plugins array: { \"name\": \"ts-vue-plugin\" }"},{"note":"Default imports are resolved; named imports are not supported.","wrong":"import { Foo } from 'Foo.vue'","symbol":"none","correct":"import Foo from 'Foo.vue'"},{"note":"Only ES6 export default syntax is recognized. CommonJS module.exports is not supported.","wrong":"module.exports = { ... }","symbol":"all exports","correct":"export default { ... }"}],"quickstart":{"code":"// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"allowSyntheticDefaultImports\": true,\n    \"plugins\": [{ \"name\": \"ts-vue-plugin\" }]\n  }\n}\n\n// Install\n// npm install ts-vue-plugin vue-template-compiler\n\n// In a .vue file (script section):\n// Only ES6 export default is supported\n// <script lang=\"ts\">\nexport default {\n  data() {\n    return {\n      message: 'Hello Vue!'\n    }\n  },\n  methods: {\n    greet() {\n      console.log(this.message)  // TypeScript intellisense works here\n    }\n  }\n}\n// </script>\n\n// Import other .vue files:\n// import Other from './Other.vue';  // Resolves type\n","lang":"typescript","description":"Shows configuration in tsconfig.json and an example .vue script that triggers TypeScript intellisense via the plugin."},"warnings":[{"fix":"Use export default { ... } syntax inside script tags.","message":"Only ES6 export default syntax is supported; CommonJS module.exports will not be recognized.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.3"},{"fix":"Use Vetur for full .vue file support (template+script+style).","message":"Only script sections are processed; template and style sections are completely ignored. No HTML/CSS completions.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.3"},{"fix":"Ensure script tag has lang=\"ts\" or lang=\"js\" or no lang attribute.","message":"Only lang=\"javascript\", lang=\"typescript\", or no lang attribute trigger the language service. Other lang values (e.g., lang=\"coffeescript\") are ignored.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.3"},{"fix":"Migrate to @vue/language-server (Volar) or Vetur for VS Code users.","message":"Package is in alpha and has not been updated since 2017. Consider using Volar for modern Vue 3 / Vue 2 TS support.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Run 'Select TypeScript version' in VS Code or set tsserver path in your editor.","message":"To use plugin outside VS Code (e.g., Emacs, Vim), you must manually configure the editor to use workspace TypeScript version.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install vue-template-compiler --save-dev","cause":"Missing peer dependency vue-template-compiler.","error":"Cannot find module 'vue-template-compiler'"},{"fix":"Check that ts-vue-plugin is installed and listed correctly in compilerOptions.plugins.","cause":"Plugin is not in node_modules or tsconfig.json is misconfigured.","error":"TypeScript plugin 'ts-vue-plugin' is not installed"},{"fix":"Ensure you use export default { ... } with an object literal; avoid variables or function returns.","cause":"Default export not wrapped due to non-object literal syntax.","error":"Property 'message' does not exist on type '{}'"},{"fix":"Add \"allowJs\": true or set \"jsx\": \"preserve\" in tsconfig.json.","cause":"Vue files inferred as TSX/JSX incorrectly.","error":"Cannot use JSX unless the '--jsx' flag is provided"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}