Organize Imports with specific ending for module node16
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Hello 👋 ,
For files with node resolution set to `node16` (and moduleResolution set to `node16` as well) , I need to append a file extension to my imports.
I create several files in memory, and call `file.organizeImports` at the end. After that I want to write the files to disc getting each files contnt with `file.getFullText()`
I found (what I think is) the right setting:
```ts
file.organizeImports({}, this.userPreferences, {
importModuleSpecifierEnding: 'js',
});
```
But it has no effect 🤔
My compiler options:
```
compilerOptions: {
module: 99,
moduleResolution: 3,
target: ScriptTarget.ESNext,
}
```
I wonder what I'm missing?
Contributor guide
Research direction
Start with the file.organizeImports entry point and its importModuleSpecifierEnding option, using the provided node16 compiler options as the reproduction. Check why the 'js' ending has no effect when files are created in memory, then verify that the generated imports contain the expected extensions before writing file.getFullText() output to disk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100