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 --input-type=ts #530

Open
4 of 6 tasks
innermatrix opened this issue Apr 19, 2024 · 2 comments
Open
4 of 6 tasks

Support --input-type=ts #530

innermatrix opened this issue Apr 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@innermatrix
Copy link

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a place to report a confirmed bug (not seek debugging help)
  • I understand this is a collaborative open source project, and relies on community contributions
  • I have read and understood the Contribution guide

Minimal reproduction URL

https://stackblitz.com/edit/node-xghdes?file=index.ts

Version

v4.7.2

Node.js version

v18.18.2

Package manager

yarn

Operating system

macOS

Problem & expected behavior (under 200 words)

All of the following failed with a SyntaxError:

echo "const x: string[] = ['']" | npx -s tsx
echo "const x: string[] = []" | npx -s tsx
echo "const x: Array<string> = ['']" | npx -s tsx
echo "const x: Array<string> = []" | npx -s tsx
echo 'fn<{ prop: Array<string> }>();' | npx -s tsx
echo 'fn<{ prop: string[] }>();' | npx -s tsx

All are valid TS AFAIK

Contributions

  • I'm interested in working on this issue
  • I'm willing to offer financial support
@innermatrix innermatrix added bug Something isn't working pending triage labels Apr 19, 2024
@privatenumber
Copy link
Owner

privatenumber commented Apr 19, 2024

This is expected behavior based on your input—as there's nothing describing that the input is TypeScript—, but looks like tsx will need to add support for --input-type=ts: https://nodejs.org/api/packages.html#--input-type-flag

@privatenumber privatenumber added enhancement New feature or request and removed pending triage bug Something isn't working labels Apr 19, 2024
@innermatrix

This comment was marked as off-topic.

@privatenumber privatenumber changed the title Syntax errors with array generic Support --input-type=ts May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants