简体   繁体   中英

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.

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.

You can exclude files with *.js and *.xml extensions from reformatting (permanently). Check the relevant documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM