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

Clarify README for tsx/jsx endings. #1179

Merged
merged 4 commits into from Dec 16, 2020
Merged

Conversation

NaridaL
Copy link
Contributor

@NaridaL NaridaL commented Dec 16, 2020

Fix #1178

@codecov
Copy link

codecov bot commented Dec 16, 2020

Codecov Report

Merging #1179 (f4e38c4) into master (d2ccc5c) will decrease coverage by 0.25%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1179      +/-   ##
==========================================
- Coverage   79.74%   79.48%   -0.26%     
==========================================
  Files          12       12              
  Lines         780      780              
  Branches      165      165              
==========================================
- Hits          622      620       -2     
  Misses        102      102              
- Partials       56       58       +2     
Flag Coverage Δ
node_10 77.02% <ø> (ø)
node_12 77.35% <ø> (ø)
node_12_15 77.35% <ø> (ø)
node_14 79.10% <ø> (-0.13%) ⬇️
node_14_13_0 78.46% <ø> (ø)
node_15 79.10% <ø> (-0.13%) ⬇️
typescript_2_7 79.10% <ø> (-0.13%) ⬇️
typescript_latest 78.46% <ø> (ø)
typescript_next 78.46% <ø> (ø)
ubuntu 79.10% <ø> (ø)
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/index.ts 78.76% <0.00%> (-0.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2ccc5c...442100d. Read the comment docs.

@NaridaL
Copy link
Contributor Author

NaridaL commented Dec 16, 2020

This isn't entirely unambiguous, as you could read it as both tsx and jsx are enabled if you set jsx, but I didn't really see a way of improving that short of introducing a table.

@cspotcode
Copy link
Collaborator

cspotcode commented Dec 16, 2020

Good point; how do you feel about this wording? Too verbose? Still ambiguous?

**TypeScript Node** works by registering the TypeScript compiler for `.ts`, `.tsx`, `.js`, and `.jsx` extensions.
`.js` and `.jsx` are only registered when allowJs is true.  `.tsx` and `.jsx` are only registered when jsx is enabled.
When node.js has an extension registered (via `require.extensions`), it will use the extension internally for module resolution.
When an extension is unknown to node.js, it handles the file as `.js` (JavaScript). By default, **TypeScript Node** avoids compiling files in `/node_modules/` for three reasons:

@NaridaL
Copy link
Contributor Author

NaridaL commented Dec 16, 2020

No, that's better 👍

@NaridaL
Copy link
Contributor Author

NaridaL commented Dec 16, 2020

I changed it. I left the link in to make it obvious that jsx refers to the compiler option in this context.

@cspotcode
Copy link
Collaborator

Thanks, I took your lead and also added the best link I could find for allowJs. If it looks good to you, I'll go ahead and merge.

@NaridaL
Copy link
Contributor Author

NaridaL commented Dec 16, 2020

Well we both tried to quote jsx at the same time. I guess you were faster 😋

LGTG

@cspotcode cspotcode merged commit ece567b into TypeStrong:master Dec 16, 2020
@cspotcode
Copy link
Collaborator

Perfect, thank you!

@cspotcode cspotcode added this to the 10.0.0 milestone May 15, 2021
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.

SyntaxError with tsx file ending.
2 participants