intellij-ideareformatting

IntelliJ IDEA disable reformat js, xml code


in our project. when commit. we have option: -reformat code -rearrange code -optimize imports. How can i disable this option for js and xml file? reformat and rearrange only java file.


Solution

  • UPD. It is possible since Intellij 2018.3. Please see the documentation for details.


    Old reply:

    You can't. Reformat is either enabled or disabled, for all files in a commit. See https://youtrack.jetbrains.com/issue/IDEA-167112

    As a workaround, you can commit files you don't want to be formatted separately. If you use Git, commit the second set with Amend, so there will still be one commit.