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

Exclude setupProxy.js from TypeScript #5590

Closed
wants to merge 1 commit into from

Conversation

brunolemos
Copy link
Contributor

@brunolemos brunolemos commented Oct 26, 2018

Fix #5587

PS: Not a fan of == null but used it to maintain the same code styling. I usually use if (!.

@Timer
Copy link
Contributor

Timer commented Oct 26, 2018

Why is this necessary? This is a JavaScript file not a TypeScript file.

@brunolemos
Copy link
Contributor Author

We have "allowJs": true, TypeScript seems to make some checks on javascript files too (not type checks, but these kind of checks).

We have "isolatedModules": true, so TypeScript requires that all files exports at least something otherwise it will show the error Cannot compile namespaces when the '--isolatedModules' flag is provided (#5587). And it can't be using module.exports for some reason (bug?), using export default fixes this. But CRA doesn't seem to accept export default on this file. We could make it accept it.

@brunolemos brunolemos changed the title Exclude setupProxy.js from TypeScript type checking Exclude setupProxy.js from TypeScript Oct 26, 2018
@Timer
Copy link
Contributor

Timer commented Oct 26, 2018

This sounds like a TypeScript bug -- it shouldn't type check/module check JS files.

@Timer
Copy link
Contributor

Timer commented Oct 28, 2018

Will be fixed as part of #5608

@Timer Timer closed this Oct 28, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants