Home > database >  IntelliJ auto format breaks Angular Sass Files
IntelliJ auto format breaks Angular Sass Files

Time:01-14

I have an Angular project using .sass stylesheets using IntelliJ IDE.

When using ::ng-deep, IntelliJ flags the double colon as an error and on reformat, splits the colons. This is highly inconvenient, as I have autoformat configured as part of my commit pipeline.

Is there a way to either:

  1. Update the style rules to recognize the double colon as valid?

OR

  1. Turn off autoformat on commit only for Sass files?

Example:

.icon-container
  width: 100%
  font-size: xxx-large
  text-align: center

  :host ::ng-deep
    text-align: center

is incorrectly formatted to:

.icon-container
  width: 100%
  font-size: xxx-large
  text-align: center

  :host: :ng-deep
    text-align: center

CodePudding user response:

Please follow WEB-42952 and linked ticket for updates.

For now, I can only suggest adding your .sass files to Do not format: list in Settings | Editor | Code Style, Formatter

  •  Tags:  
  • Related