A tiny tool to run vue-tsc on specific files without ignoring tsconfig.json.
Ported from tsc-files.
npm i -D @itoxiq/vue-tsc-filesyarn add -D @itoxiq/vue-tsc-filesI wanted to type-check only the staged files with lint-staged.
With lint-staged:
{
"lint-staged": {
"**/*.{vue,ts,tsx}": "vue-tsc-files"
}
}Flag "--noEmit" is always passed to underlying vue-tsc by default.
vue-tsc-files passes module declarations and namespaces from d.ts files to vue-tsc, so please make sure that needed declarations are inside d.ts files.
// example.d.ts
declare module "@vue/runtime-core" {
interface ComponentCustomProperties {
$custom: MyCustomType;
}
}Released under the MIT License.