reference:http://blog.csdn.net/jmyue/article/details/11060003
Large projects are often done together by a lot of people, but everyone has their own style, which leads to the fact that the code for the entire project is not only inconsistent with the language specification, but also very difficult to read. Therefore, this kind of project will introduce Checkstyle, to standardize everyone's coding style, try to be unified and reasonable. After we have written the code, we have to take the time to manually solve the problem of the Checkstyle prompt, which is a very boring and time-consuming task. Here's how to take advantage of the eclipse configuration, and after we've written the code and saved it, Eclipse will automatically help us solve the checkstyle problem.
1. Formatter settings
Menu:suitecloudide---Preferences, JavaScript---Code Style--Formatter
Shortcut keys: Command +,
The active profile displays the code that is currently in use to automatically format the configuration. Click the "Export All ..." button to export the Code auto-format configuration in Eclipse, click the "Import ..." button to import the locally existing configuration file, and the imported and exported files are in XML format. You can click on the "New ..." button to create a new configuration of your own, based on an existing configuration in eclipse.
After the formatter is set up, you can format the selected code using OPTION + Command + F or the right-click menu, Source-. (Mac shortcut key)
2. Save Actions Settings
Select "Perform the selected actions on save" and the following three check boxes, where "Format source code" is to automatically format the code in the save file according to the formatter set above, and the entire JS file will be formatted with format.
Javascript > Eclipse > Automatic Code Normalization