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

no errors TypeScript errors reported for .js when enabling checks using // @ts-check #1004

Closed
reinholdk opened this issue Sep 17, 2019 · 5 comments · Fixed by #1008
Closed

Comments

@reinholdk
Copy link
Contributor

reinholdk commented Sep 17, 2019

Expected Behaviour

TypeScript errors shall be reported for .js files, if "checkJS": false in tsconfig.json but enabled for a few files selectively using // @ts-check .

Actual Behaviour

no TypeScript errors are reported for such .js files

Steps to Reproduce the Problem

Build the repo linked below, the error in test.js is not reported.

Location of a Minimal Repository that Demonstrates the Issue.

https://github.com/reinholdk/ts-loader-sample

@johnnyreilly
Copy link
Member

johnnyreilly commented Sep 17, 2019

I suspect this isn't ts-loader related and rather TypeScript compiler related. I don't have time to dig into this right now but I have a feeling this will be the case...

@reinholdk
Copy link
Contributor Author

reinholdk commented Sep 17, 2019

@johnnyreilly isn't the problem caused by this condition?

compilerOptions.checkJs === true

@johnnyreilly
Copy link
Member

johnnyreilly commented Sep 17, 2019

You may be correct. Do you want to try it out and see if that's the case?

If it is then I'm wondering what a fix looks like. Always including js / jsx files is a possibility. I wonder if that would create any problems

@reinholdk
Copy link
Contributor Author

reinholdk commented Sep 18, 2019

Have tried the following change successfully compilerOptions.allowJs === true which seems to me the correct condition to include js/jsx files.

@johnnyreilly
Copy link
Member

johnnyreilly commented Sep 18, 2019

Want to submit a PR?

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 a pull request may close this issue.

2 participants