Skip to content

Don't require ts-jest and typescript if you're not using typescript #302

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

Closed
wants to merge 2 commits into from

Conversation

boboldehampsink
Copy link

@lmiller1990
Copy link
Member

lmiller1990 commented Nov 23, 2020

Thanks! Seems the linter is failing - can you yarn lint:fix (or whatever the command is).

I can release this once it's passing and merged up.

@boboldehampsink
Copy link
Author

@lmiller1990 running yarn lint:fix doesn't yield any changes, but I did change false to null to be more consistent and more correct

@boboldehampsink
Copy link
Author

Seems that fixed the issue as well

@lmiller1990
Copy link
Member

Thanks, one last question any reason to do === false instead of the usual if (!getVueJestConfig(config).tsConfig)) { ?

@boboldehampsink
Copy link
Author

@lmiller1990 yeah we want the user to explicitly disable typescript. So this only works when that value is false, not when it is, for example, omitted

@lmiller1990
Copy link
Member

lmiller1990 commented Nov 24, 2020

I think I am confused here. Isn't the current problem that TS is required even when the user isn't using TS in their project? I don't think the user should have to opt out - if they are not using TS (eg, no tsconfig present) then that should be enough to know they are not using TS.

I don't think this has anything to do with the vue-jest config at all - we should check if there is a tsconfig.json, if there isn't return early, or something to that meaning.

Or maybe I've misunderstood something about the problem and/or proposed solution?

@boboldehampsink
Copy link
Author

@lmiller1990 agree, but I'm just looking at the docs which say to explicitly disable typescript because tsConfig's default is true: https://github.com/vuejs/vue-jest#boolean-1

@lmiller1990
Copy link
Member

Interesting that seems like a kind of bad default. I think we should do what makes sense, I doubt most people would think to look for this kind of config option. What do you think? Are you interested in implementing the above (check for a ts-config, if there isn't one, do not use TS)?

@boboldehampsink
Copy link
Author

Sorry, don't have the time or package knowledge to think about how this should work properly. For now I am already helped if this PR can be merged and released, so that I (and others) can use this without TS at least. You should create a new issue for this, so that a new PR can be submitted.

@lmiller1990
Copy link
Member

All good, I will add a commit to this PR! Thanks for your help 👍

@boboldehampsink
Copy link
Author

@lmiller1990 can we get this out in the meanwhile?

@lmiller1990
Copy link
Member

What do you think about this solution instead? #307

@lmiller1990
Copy link
Member

Closed in favor of #307

@lmiller1990 lmiller1990 closed this Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants