Search code examples
angularintellij-idea

When adding getters, IDEA adds an underscore to variable names


In an Angular project, when adding getters, IDEA adds an underscore to variable names.

Is it possible to configure the IDE so that it does the opposite - adds this symbol to getters, but does not change the names of variables?


Solution

  • IDE create names in accordance to JavaScript/TypeScript naming conventions. You can configure it in

    • Settings (Preferences on macOS) | Editor | Code Style | JavaScript | Code Generation | Naming Conventions | Field prefix:
    • Settings (Preferences on macOS) | Editor | Code Style | TypeScript | Code Generation | Naming Conventions | Field prefix: