Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kcmr/vsce-remove-unused-imports
VS Code extension to remove unused ES6 imports inside JavaScript and TypeScript files
https://github.com/kcmr/vsce-remove-unused-imports
vscode-extension
Last synced: 3 months ago
JSON representation
VS Code extension to remove unused ES6 imports inside JavaScript and TypeScript files
- Host: GitHub
- URL: https://github.com/kcmr/vsce-remove-unused-imports
- Owner: kcmr
- License: mit
- Created: 2021-08-13T11:09:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-26T23:43:08.000Z (8 months ago)
- Last Synced: 2024-10-04T13:44:00.839Z (4 months ago)
- Topics: vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=kuscamara.remove-unused-imports
- Size: 5.26 MB
- Stars: 17
- Watchers: 1
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Remove Unused Imports
## Description
VS Code extension to remove unused ES6 imports inside JavaScript and TypeScript files (`.js`, `.jsx`, `.ts` and `.tsx` extensions) without changing the current order, as opposed to the built-in VS Code "Organize Imports" functionality.
![Remove Unused Imports screenshot](images/remove-unused-imports.gif)
## Usage
- **Open the Command Palette** (`Ctrl/Cmd + Shift + P`)
- Search for **Remove Unused Imports**### Run on save
The command can be executed every time a file is saved via Code Actions. To enable it, set `source.removeUnusedImports` to `true` inside `editor.codeActionsOnSave` in your VSCode settings:
```json
"editor.codeActionsOnSave": {
"source.removeUnusedImports": true
}
```### Keybinding
This extension **does not provide any keybinding** for the command. You can assign your own custom keybinding for it by pressing the cog icon that appears to the right of the command name in the Command Palette.
## Known issues
The format of the document may change after running this command. For instance, final semicolons are added to the modified imports.
## Acknowledgments
This extension is inspired by [vsc-sort-imports](https://github.com/amatiasq/vsc-sort-imports).
## Support me
## License
This project is licensed under the [MIT License](LICENSE).