
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vue-script-tsc
Advanced tools
⚡️ A lightning fast TypeScript type checker for Vue SFC Script tags ⚡️
<script> tags of .vue files + any related .ts filestsconfig.jsonTo get started, install vue-script-tsc.
yarn add -D vue-script-tsc
You can run vue-script-tsc as a script in package.json, either by itself or as part of a build process:
// package.json
"scripts": {
"tsc": "vue-script-tsc --root .",
"build": "vue-script-tsc --root . && vue-cli-service build"
}
Or on the command line:
# Command line
yarn vue-script-tsc --root .
You can call vue-script-tsc within your own script.
const { tsc } = require('vue-script-tsc');
tsc({
root: process.cwd()
})
.then(() => {
console.log('Type Check Complete')
})
.catch((err) => {
console.error(err)
process.exit(1)
})
You can specify some arguments with either usage. For CLI arguments prepend with a --, for example --root src. For programmatic pass an options object with these as keys.
| Option | Default | Description |
|---|---|---|
root | Current Directory | The relative path to the directory to be treated as the root (where your tsconfig.json file exists) |
tsconfig | tsconfig.json | The name of your tsconfig.json file (*) |
(*) It is recommended you use a dedicated tsconfig.json for vue-script-tsc. If you use incremental builds you should specify a different compilerOptions.tsBuildInfoFile.
<script setup> (which vue-script-tsc does not)Type checking SFC (.vue) files, especially in Vue2, can be a painful process. The main problem is that the SFC layout means that it has to be preprocessed into TypeScript first, including converting the Template into a render function that can be type checked.
However the bulk of the logic is in the <script> tag, which in itself is just TypeScript. So if we ignore everything else except that then the only preprocessing we need is to remove everything except what is in that tag. This is essentially how vue-script-tsc works. We create a custom compiler host which extracts only the <script> tag from .vue files.
The only other caveat is that TypeScript will refuse to check a file that does not have an extension it recognises. So we trick it into processing them by appending .ts whenever referring to a .vue file, which we then remove when actually trying to access the file.
Please see LICENSE.
FAQs
A lightning fast TypeScript type checker for Vue SFC Script tags
The npm package vue-script-tsc receives a total of 114 weekly downloads. As such, vue-script-tsc popularity was classified as not popular.
We found that vue-script-tsc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.