vscode: configure source.organizeImports, disable source.fixAll.ts#3964
Open
vscode: configure source.organizeImports, disable source.fixAll.ts#3964
source.organizeImports, disable source.fixAll.ts#3964Conversation
source.organizeImportssource.organizeImports, disable source.fixAll.ts
98f6a54 to
43e137f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's basically impossible to find docs on vscode's settings online,
but
organizeImportssorts imports (import lines + named imports) and removes unused imports.I've enabled it so that we can sort named imports on save, until oxfmt handles it.
Caveats:
import type {} from 'a';aboveimport {} from 'a';Had to save all the files manually to see the impact.
WDYT? I don't mind reverting the import/export orders.
We could live without it.
As I understand it,
source.organizeImportsmerges these two settings into one:so we could keep
source.removeUnusedImportsonly.Also disabled
source.fixAll.tsas it's very annoying when vscode removes unreachable code on save when debugging.https://code.visualstudio.com/docs/typescript/typescript-refactoring#_organize-imports
https://code.visualstudio.com/docs/configure/settings
https://code.visualstudio.com/docs/reference/default-settings
We could also set
"allowUnreachableCode": false,intsconfig.base.json,so that
tscreports unreachable code as an error.The default is to report unreachable code in the editor, but not report it when running the
tsccli.I wonder if it'd help agents if they prioritize TypeScript?
https://www.typescriptlang.org/tsconfig/#allowUnreachableCode