vue-cli: How can I get compilation error without build?

Version

3.1.1

Node and OS info

Node 8.14.0 / yarn 1.12.1 / macOS 10.14

Steps to reproduce

  1. Generate a vue-typescript project.
  2. Write some code having ts-error.
  3. Run npm run lint and it reports nothing error.
  4. Run npm run build and it said the ts-error

What is expected?

Want a way to get ts error without build.

What is actually happening?

Can’t get ts-error without build


If I use .ts file to write vue component, it actually goes well by using tsc --noEmit -p .. But it can’t in .vue file. What should I do?

I want this feature because I need to check the code whether has problem before commit.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 15
  • Comments: 32 (11 by maintainers)

Most upvoted comments

This seems like a joke. Besides all efforts to migrate Vue to Typescript and sell itself as a type friendly library, its CLI team doesn’t think it’s important to have a way to check types in Vue files without build.

@harishabe

Thank your for your interest in this project.

However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).

We encourage you to ask it on the forum , Stack Overflow or on our Discord chat and are happy to help you out there.

For vue 3 there is now vue-tsc for the command line and volar for IDE integration.