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

Open
WolfspiritM opened this Issue Feb 27, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@WolfspiritM
Copy link

WolfspiritM commented Feb 27, 2019

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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

johnnyreilly commented Feb 27, 2019

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 WolfspiritM referenced a pull request that will close this issue Feb 28, 2019

Open

WIP: Fix incremental api for vue files (#219) #220

WolfspiritM added a commit to WolfspiritM/fork-ts-checker-webpack-plugin that referenced this issue Mar 4, 2019

@0xorial

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

johnnyreilly commented Mar 14, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.