You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Semicolon is added when organize import in specific case聽#50817
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true// "source.sortImports": true // This also append when this is enabled
},
"typescript.tsdk": "./node_modules/typescript/lib"
}
Prettier config (.prettierrc)
{
"semi": false
}
馃檨 Actual behavior
When i save file, this add semicolon on all import.
馃檪 Expected behavior
No add semicolon on import.
Additional information
That issue ONLY append when i have an type write like that { var1: number; var2: string }, so i think the organize/sort (maybe from here #31801) think the semicolon is used because is present in code.
TypeScript doesn't know about prettier and uses a heuristic to figure out it if seems like you're using semicolons or not. Since you could have used a comma to separate var1 and var2, this appears to be a "semicolon-friendly" codebase based on that heuristic.
Set the "Semicolons" formatter option according to your formatting style:
Activity
RyanCavanaugh commentedon Sep 20, 2022
TypeScript doesn't know about prettier and uses a heuristic to figure out it if seems like you're using semicolons or not. Since you could have used a comma to separate
var1andvar2, this appears to be a "semicolon-friendly" codebase based on that heuristic.Set the "Semicolons" formatter option according to your formatting style:
