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

Support for TypeScript React (*.tsx) #189

Closed
dfoverdx opened this issue Dec 21, 2018 · 4 comments · Fixed by #193
Closed

Support for TypeScript React (*.tsx) #189

dfoverdx opened this issue Dec 21, 2018 · 4 comments · Fixed by #193

Comments

@dfoverdx
Copy link

dfoverdx commented Dec 21, 2018

It looks like JavaScript React (*.jsx) files and TypeScript (*.ts) files are supported, but TypeScript React (*.tsx) files don't appear to be. Either that, or I'm doing something wrong. (I just learned of the existence of Madge 15 minutes ago.)

I'm running npx madge --extensions js,jsx,ts,tsx ./components/my-component.tsx and it's producing a "tree" of that single file.

@dfoverdx
Copy link
Author

I think I must be doing something wrong. It works for some .tsx files but only a couple. I have no idea why, nor how to debug it.

mrjoelkemp added a commit to mrjoelkemp/detective-typescript that referenced this issue Dec 24, 2018
mrjoelkemp added a commit to dependents/node-precinct that referenced this issue Dec 24, 2018
mrjoelkemp added a commit to dependents/node-precinct that referenced this issue Dec 24, 2018
mrjoelkemp added a commit to dependents/node-filing-cabinet that referenced this issue Dec 24, 2018
mrjoelkemp added a commit to dependents/node-filing-cabinet that referenced this issue Dec 24, 2018
mrjoelkemp added a commit to dependents/node-dependency-tree that referenced this issue Dec 24, 2018
@mrjoelkemp
Copy link
Contributor

Thanks for reporting @dfoverdx. Proper tsx support has landed all the way through the core dependencies and accessible via dependency-tree 6.4.0.

The remaining bit of work is bumping the dependency-tree version in Madge and adding a test to make sure that tsx files are parsed.

Without that, you can reinstall Madge and the caret declaration of dependency-tree should get you the latest version automatically. Give it a spin and let me know if it changes anything in your case..

@pahen
Copy link
Owner

pahen commented Dec 28, 2018

Can you confirm that it works for you now @dfoverdx ? I fit does, I'll create a new release of Madge with updated dependencies.

@fatso83
Copy link

fatso83 commented Dec 13, 2019

@pahen Does this mean detective-typescript supports TSX files? After coming across dependency-check-team/dependency-check#112 I was under the impression that it only worked for plain Typescript files.

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.

4 participants