/vscode-simple-javascript-refactorings

automated refactorings and code actions for JS, TS, JSX & TSX via VSCode extension

Primary LanguageTypeScriptMIT LicenseMIT

version last updated downloads license

simple javascript refactorings

extension that provides lightweight, useful code actions to improve your code

Features

  • JS(X)/TS(X)
    • remove curly braces, quotes, & $ from simple unnecessary template strings (e.g. prop={`${STR_CONST}`} -> prop={STR_CONST})
  • JSX/TSX
    • remove unnecessary braces from simple expressions (e.g. prop={`string`} -> prop="string")
    • single line only

Usage

  • code action (diagnostics)

Extension Settings

N/A for now, but open to tweaking based on most common usages

TODO

  • write tests
  • evaluate making this a TypeScript Language Service Plugin (see example plugin) to leverage ASTs
  • try making an "auto" refactor mode for some code actions
  • add more refactorings

Reporting issues

report any issues on the github issues page, and please provide as much detail as possible!

License

This project is licensed under the MIT License - see the LICENSE file for details