10

I want to change in a project from javascript to typescript. Therefore i want to change the extensions of all files from *.js to *.ts recursively. How do i accomplish it with webstorm?

David Michael Gang
  • 6,723
  • 8
  • 48
  • 94

2 Answers2

11

There's no way to rename multiple files in the project in WebStorm, unfortunately. You can vote for the related issue on JetBrains issue tracker.

Ekaterina Prigara
  • 4,087
  • 2
  • 20
  • 17
6

Do it outside of Webstorm on linux (or Windows git bash) with ..

cd my-folder

find . -name "*.t1" -exec bash -c 'mv "$1" "${1%.t1}".t2' - '{}' \;

courtesy of Recursively change file extensions in Bash

This works recursively, make sure you cd to the correct folder first (typically your project root folder).

Community
  • 1
  • 1
danday74
  • 45,909
  • 39
  • 198
  • 245
  • 1
    If you want to keep all the `git` history then add `git` before the `mv`, like that `find . -name "*.t1" -exec bash -c 'git mv "$1" "${1%.t1}".t2' - '{}' \; ` – AvielNiego Jun 06 '20 at 15:20