Gathering detailed insights and metrics for vue-script-tsc
Gathering detailed insights and metrics for vue-script-tsc
Gathering detailed insights and metrics for vue-script-tsc
Gathering detailed insights and metrics for vue-script-tsc
A lightning fast TypeScript type checker for Vue SFC Script tags
npm install vue-script-tsc
Typescript
Module System
Node Version
NPM Version
68.3
Supply Chain
98.8
Quality
75.5
Maintenance
100
Vulnerability
99.6
License
TypeScript (87.47%)
JavaScript (11.43%)
Shell (1.11%)
Total Downloads
71,533
Last Day
1
Last Week
385
Last Month
1,908
Last Year
29,385
BSD-3-Clause License
7 Stars
36 Commits
1 Watchers
1 Branches
3 Contributors
Updated on Nov 22, 2022
Minified
Minified + Gzipped
Latest Version
1.3.1
Package Id
vue-script-tsc@1.3.1
Unpacked Size
19.80 kB
Size
7.30 kB
File Count
18
NPM Version
8.19.3
Node Version
18.12.0
Cumulative downloads
Total Downloads
Last Day
-85.7%
1
Compared to previous day
Last Week
-22.7%
385
Compared to previous week
Last Month
-0.8%
1,908
Compared to previous month
Last Year
21.1%
29,385
Compared to previous year
1
1
⚡️ A lightning fast TypeScript type checker for Vue SFC Script tags ⚡️
<script>
tags of .vue
files + any related .ts
filestsconfig.json
To get started, install vue-script-tsc
.
1yarn 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:
1// package.json 2"scripts": { 3 "tsc": "vue-script-tsc --root .", 4 "build": "vue-script-tsc --root . && vue-cli-service build" 5}
Or on the command line:
1# Command line 2yarn vue-script-tsc --root .
You can call vue-script-tsc
within your own script.
1const { tsc } = require('vue-script-tsc'); 2 3tsc({ 4 root: process.cwd() 5}) 6 .then(() => { 7 console.log('Type Check Complete') 8 }) 9 .catch((err) => { 10 console.error(err) 11 process.exit(1) 12 })
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.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More