Closed you227 closed 3 years ago
Try adding "exclude": ["node_modules"]
in your tsconfig.json
Added configuration but it didn't work
vue-tsc version 0.2.2
tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"paths": {
// 根据别名配置相关路径
"@/*": ["./src/*"]
},
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["node_modules"],
}
Please config skipLibCheck in tsconfig or --skipLibCheck
in cli. See https://github.com/johnsoncodehk/vue-tsc/issues/16#issuecomment-818426244.
@johnsoncodehk
Added the vue-tsc --noEmit --skipLibCheck
command, the *.d.ts
file was ignored, but the *.ts
file was still scanned
--skipLibCheck
Skip type checking of declaration files.
vue-tsc --noEmit --skipLibCheck
output
> build
> vue-tsc --noEmit --skipLibCheck && vite build --mode production
node_modules/element-plus/lib/utils/types.ts:24:26 - error TS2304: Cannot find name 'Nullable'.
24 export type RefElement = Nullable<HTMLElement>
@you227 Maybe node_modules/element-plus/lib/utils/types.ts
has references in src so it can't be ignore.
message