We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
Version: 25.0.1
When moveToDirectory is used, the import statements' extensions are lost.
moveToDirectory
To Reproduce
import { Project } from "ts-morph"; const project = new Project({ tsConfigFilePath: path.join(packagePath, 'tsconfig.json'), manipulationSettings: { indentationText: IndentationText.TwoSpaces, quoteKind: QuoteKind.Double, insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, useTrailingCommas: true, }, }); sourceFile.addImportDeclaration({ moduleSpecifier: '../App.js', namedImports: ['App'], }); sourceFile.moveToDirectory('subDir');
Expected behavior
Without moveToDirectory is used, import statement looks like this.
import { App } from '../App.js';
After
import { App } from '../../App'; // .js extension is lost.
Other move methods like moveImmediately also seems to be affected.
moveImmediately
tsconfig
{ "compilerOptions": { "lib": ["ES2022"], "target": "ES2022", "module": "Node16", "moduleResolution": "node16", "declaration": true, "strict": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": true, "noEmitOnError": true } }
The text was updated successfully, but these errors were encountered:
.js
"moduleResolution": "nodenext"
It became a blocker for users who have "moduleResolution": "nodenext" in their tsconfig.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Version: 25.0.1
When
moveToDirectory
is used, the import statements' extensions are lost.To Reproduce
Expected behavior
Without
moveToDirectory
is used, import statement looks like this.After
Other move methods like
moveImmediately
also seems to be affected.tsconfig
The text was updated successfully, but these errors were encountered: