vuejs/vue-cli

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

Open

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

在 GitHub 查看
 (3 评论) (21 反应) (0 负责人)JavaScript (29,754 star) (6,328 fork)batch import
feature requesthelp wantedscope: typescript

描述

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.

贡献者指南

Expose vue-cli's TypeScript typing service as a command · vuejs/vue-cli#1891 | Good First Issue