microsoft / microsoft/TypeScript

[Feature Request] Ability to auto-generate a type file for local JS module

Open
#37,918 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

I'm facing the current issue when importing a JS file into a TS project

image

The solution is to create a @types/cognitoAuth/index.d.ts file for the types, or convert the file to typescript.

It would be great if in vscode we could use the code action feature ( CTRL + . ) to either generate an empty types file with boilerplate, or try convert file to TS?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the TypeScript language-service code-action support and the local JavaScript-module workflow described in the issue. Determine whether the goal is boilerplate declaration generation, JavaScript-to-TypeScript conversion, or both; done means a VS Code action provides the agreed result for a local JS import.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.