-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add instructions for getting type checking to work for JS projects #174
Conversation
docs/USAGE.md
Outdated
1. [OPTIONAL] By default, `rnwinrt.exe` will output `*.d.ts` type declaration files under the path `/windows/WinRTTurboModule/Generated Files/types`. If your project is using TypeScript, these files will get picked up automatically, assuming you haven't changed your `tsconfig.json` to exclude it. If you are using Javascript as well as Visual Studio Code to edit files, you can follow the instructions outlined [here](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_type-checking-javascript) to get type checking as well as auto-complete. Namely, this involves adding a `jsconfig.json` to the root of your project and the coment `// @ts-check` to the top of all desired `*.js` files. If you are using an editor other than Visual Studio code, then you may need to consult your editor's documentation as these steps may not work for you, if the scenario is even supported at all. | ||
|
||
* *NOTE: There are currently a number of known issues with the generation of type declaration files, so you may see some innocuous errors reported by the editor, even though the code will work properly in practice* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break this up into a couple of lines?
also maybe we should just say "rename your app.js to app.tsx" as the 1st option, and give the other options as fallbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't renaming the file have other implications? E.g. such as needing to declare types everywhere? Or is the default in TS to just assume that anything unmarked is any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
people will usually have @types/react etc included in their project but I suppose folks can use react native from non TS too. The default template is confusing though. @acoates-ms thoughts? (not sure if he'll get this msg since the repo is private still, message offline if not)
Co-authored-by: angelazhangmsft <[email protected]>
Co-authored-by: Alexander Sklar <[email protected]>
This is not really relevant any more with the changes to add the npm package |
Fixes #159