-
-
Notifications
You must be signed in to change notification settings - Fork 18
Allow Ability to Set Preference on Unused Import Removal #273
Comments
Looks like this might be possible. In order to implement this I'll need to pass that through from Then I can pass an option from the extension here:
|
It looks like this feature will be new in TypeScript 4.4, which is still in beta currently: |
Another option I'd recommend if you're looking to improve your experience is to disable organize imports on save through this extension and replace it with an ESLint rule that organizes imports, using https://github.com/apexskier/nova-eslint, and enabling eslint's fix on save. |
This adds support for the new skipDestructiveCodeActions argument to TypeScript's organize imports feature - [1] to support [2]. Support is added in two places: - Automatically inferring the proper value based on diagnostics for the file when returning code actions. - Supporting sending it when manually executing the organize imports action. Also added documentation to the readme about the supported commands that can be manually executed. [1] microsoft/TypeScript#43051 [2] apexskier/nova-typescript#273 Co-authored-by: Rafal Chlodnicki <[email protected]>
Using feature added to the language server in v0.7.0 Resolves #273
* Setting to prevent unused import removal Using feature added to the language server in v0.7.0 Resolves #273 * Changelog
Included in release v2.6.0 |
First of all: Thank you for your work on this! I have a habit of hitting CMD + S often as I'm writing code. Having the formatter organise and rearrange imports during those keystrokes is great –– however, having it remove an import that I haven't yet used is a little frustrating. I'd really appreciate the ability to disable that functionality.
The text was updated successfully, but these errors were encountered: