Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue files are not type checked or linted with useTypescriptIncrementalApi #219

Closed
WolfspiritM opened this issue Feb 27, 2019 · 6 comments
Closed

Comments

@WolfspiritM
Copy link

Hi,

My config is:

            new ForkTsCheckerWebpackPlugin({
                tsconfig: './tsconfig.json',
                tslint: './tslint.json',
                vue: true,
                async: false,
                formatter: "codeframe",
                useTypescriptIncrementalApi: true,
                measureCompilationTime: true
            }),

Using that config an error I implemented in a vue file is not checked:
e.g.:

const test: string = 1234562123;

Does not produce any error.

Changing useTypescriptIncrementalApi to false works but is much slower.

@johnnyreilly
Copy link
Member

johnnyreilly commented Feb 27, 2019

Thanks for reporting. We have integration tests that check that Vue errors etc are caught:

https://github.com/Realytics/fork-ts-checker-webpack-plugin/blob/master/test/integration/incrementalApi.spec.js

Could you compare your setup with this please? I'm keen we understand why you might not be picking up errors with your config. It might help you're able to produce a minimal reproduction of the issue and then compare that to our integration tests.

Neither myself or the implementors of this support are Vue users and so we may benefit from assistance with this. 😉

Any help you can provide would be greatly appreciated!

@WolfspiritM
Copy link
Author

WolfspiritM commented Feb 27, 2019

Thanks for the answer.

I can't really find a big difference when it comes to configuration but it seems there is no test that checks for type and linting errors directly in *.vue files (or I missed that).
Maybe it's also just related to the output/cli?

I made a sample project here:
https://github.com/WolfspiritM/simplevue

npm install
npm run build

In that code results with:

Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
Hash: d042033d16e0ac6c5f8f
Version: webpack 4.29.5
Time: 2274ms
Built at: 2019-02-27 22:06:50
Entrypoint bundle = js/bundle.js
[0] multi ./scripts/app.ts 28 bytes {bundle} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {bundle} [built]
[./scripts/app.ts] 170 bytes {bundle} [built]
    + 14 hidden modules

Even so the ./scripts/components/HelloWorld.vue file contains a type error.
Changing the webpack config to not use the new api and running build again the error is correctly reported.

@johnnyreilly
Copy link
Member

Thanks so much for that. I think you may have identified a bug. If you (or anyone else) is able to take a look I'd greatly appreciate the assistance.

In the meantime I'll change the plugin so it doesn't default to use the incremental API with Vue projects. I'll make we get that in for the 1.0.0 release.

WolfspiritM added a commit to WolfspiritM/fork-ts-checker-webpack-plugin that referenced this issue Feb 28, 2019
WolfspiritM added a commit to WolfspiritM/fork-ts-checker-webpack-plugin that referenced this issue Feb 28, 2019
WolfspiritM added a commit to WolfspiritM/fork-ts-checker-webpack-plugin that referenced this issue Mar 4, 2019
@0xorial
Copy link
Contributor

0xorial commented Mar 14, 2019

I had a fresh look at the tests, and vue tests for useTypescriptIncrementalApi are quite poor - there is only one test actually testing for errors and it is wrong (there should 2 errors, not 1).
@johnnyreilly, what do you think about applying same technique as in index.spec.js ? (creating two sets of tests for incremental compilation true/false )

@johnnyreilly
Copy link
Member

Completely agree @0xorial.

I believe @WolfspiritM has been working on trying to fix the issue here: #220

I'm not too sure how things are going.

@piotr-oles
Copy link
Collaborator

@WolfspiritM
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which supports Vue.js with the Watch API 🚀(note: TypeScript >= 3.8.0 required)
I will close this issue to clean-up the backlog :)

@piotr-oles piotr-oles unpinned this issue May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants