vuejs/vue-cli

Expose vue-cli's TypeScript typing service as a command

开放

#1,891 创建于 2018年7月18日

 (3 条评论) (21 个反应) (0 位负责人)JavaScript (6,328 个派生)batch import
feature requesthelp wantedscope: typescript

仓库指标

星标
 (29,754 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

What problem does this feature solve?

Sometimes as a developer you want to check the validity of your types without having to launch yarn serve, which takes more time. And even though you can check the types of the .ts files with tsc -p tsconfig.json --pretty --noEmit this does not check .vue files. I haven't been able to reproduce the same command vue-cli-service executes, which is why I'm issuing this feature request.

Another reason why this would be interesting is to hook this command inside CI to fail the build if the types are not correct, because right now you can't do that, as the typing errors are shown on the command line as messages and do not have an exit code.

What does the proposed API look like?

vue-cli-service type [options]

Note that this should propagate TypeScript's options. For instance, the user should be able to pass the flag --noEmit in order for TypeScript not to compile, or whatever options.

贡献者指南