WebStorm 2021.1 Help

Project settings

In WebStorm, you can configure settings for specific projects or globally, at the IDE level, see Configuring the IDE for details.

The project level settings are applied to the current project only. These settings are stored as xml files in the .idea directory of your project folder:

  • The <project name>.iml file describes the project structure.

  • The workspace.xml file contains your workspace preferences including Run/debug configurations.

  • Each xml file is responsible for its own set of settings, that can be recognized by its name: projectCodeStyle.xml, encodings.xml, vcs.xml and so on.

    Thus, for example, adding a new run/debug configuration and changing encoding will affect two different xml files. This helps avoid merge conflicts when the project settings are stored in a version control system and modified by the different team members.

To configure project settings, select WebStorm | Preferences for macOS (Ctrl+Alt+S) or File | Settings for Windows and Linux.

In the Settings/Preferences dialog, settings that are marked with the Project configurable icon apply only to the current project. Other settings are global and apply to all existing projects.

Project abd global settings marked in the Settings/Preferences dialog

Share your project settings

Sharing your project settings is helpful when a team works on the same project, while Share IDE settings may come in handy if you use WebStorm on several machines.

If your project is under version control, it is recommended that all XML files from the .idea directory except workspace.xml should also be under version control. The workspace.xml file stores user-specific settings that should not be shared.

Refer to JetBrains.gitignore on GitHub to see what should be ignored.

Configuration files are processed according to your choice. Once you modify the project settings, and a new configuration file is created, the IDE shows a notification at the bottom of the screen prompting you to select how you want to treat configuration files in this project:

  • View files: view the list of created configuration files and select, which of them you want to place under version control. After that, the selected files will be scheduled for addition to VCS.

  • Always Add: silently schedule all configuration files created in the .idea directory for addition to VCS (applies only to the current project).

  • Don't Ask Again: never schedule configuration files for addition to VCS; they will have the unversioned status until you manually add them to VCS (applies only to the current project).

If you close the notification without selecting any option, it will appear again after a new configuration file is created. The new file will also go to the list that will be there until you select one of the options even if you restart the IDE.

Notification prompting to select how to treat
                    configuration files

List of non-shareable configuration files

WebStorm identifies configuration files and adds them to the list of ignored files automatically. However, if you are sharing your project manually, we recommend that you avoid placing these files and folders under version control:

  • .idea/workspace.xml
  • .idea/usage.statistics.xml
  • .idea/dictionaries folder

  • .idea/shelf folder

For the full list of files, refer to How to manage projects under Version Control Systems and JetBrains.gitignore.

Copy global settings to the project level

Global (IDE) settings are stored separately from projects. That is why, these settings are not shared through version control together with the project.

Some settings, however, can be copied to the project level. For example, you can create a copy of your code style configuration, inspection profiles, the list of classes and packages excluded from code completion and auto-import. If you do so, the IDE creates the corresponding configuration files in the .idea directory that you can share together with the project through VCS.

To share project settings between already existing projects, you can also use the Settings Repository or the Settings Sync plugin. You can also export the settings to a ZIP archive and import it later to other IDE instances.

Default settings for new projects

You can configure project settings not only for the current project, but for all projects that you will create later. This means that you can set the new default settings for your projects.

  • From the main menu, select File | New Projects Settings | Settings/Preferences for New Projects.

If you have a project with settings and configuration that you want to reproduce in new projects, you can save this project as a custom project template and then use this template for product creation. Learn more from Project templates.

Last modified: 21 June 2021