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
  • 7,107
  • 8
  • 53
  • 98

2 Answers2

13

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,697
  • 3
  • 21
  • 17
9

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
  • 52,471
  • 49
  • 232
  • 283
  • 3
    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