Detect Typescript in Javascript editors opened and inform developer, that he is writing different syntax and it will silently fail (probably)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
Research direction
The issue names no files, tests, or entry points. Start by locating where editor diagnostics or language-service suggestions are implemented, then determine how syntax detection and rename, removal, or ignore actions would fit; done means the proposed warning works for the listed extensions without disrupting valid JavaScript.
Written by the indexing model from the issue text.
Description
It would be super helpful to have something like:
Warning: TypeScript syntax detected in .jsx file.
Would you like to:
[ ] Rename to .tsx
[ ] Remove TypeScript syntax
[ ] Ignore warning
This kind of UX improvement could save developers (especially those transitioning between JS and TS projects) a lot of time and frustration. It seems like a relatively straightforward detection that could help a lot of people!
VSCode already does similar helpful suggestions for other cases (like offering to create files that don't exist when you import them), so this would fit right in with that philosophy.
What it would solve?
It's the classic .jsx vs .tsx gotcha! 😄
This is such a common issue that even experienced developers run into it regularly. The file extension makes all the difference because:
.jsxfiles are treated as regular JavaScript/React files.tsxfiles are treated as TypeScript/React files
So TypeScript typing just "silently fails" to work in .jsx files without any obvious error message about why the types aren't working.
It's one of those "spend an hour debugging only to realize it's a file extension" moments that every developer has experienced!
.CJS->.TS,.JS->.TS,.JSX->.TSX
(Similar functionality could be created for CSS -> SCSS, ... .)
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microsoft/TypeScript#64322 · 2 comments · 1 reaction · 2 assignees ·
-
Possible Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64278 · 1 comment · 1 reaction ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/TypeScript#64118 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/TypeScript#64094 ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/TypeScript#63959 · 5 comments ·
All issues in microsoft/TypeScript
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100