Skip to content

Wrong use of js-comment-in-css in scss #32807

@fudom

Description

@fudom

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

Yes

Description

▲ [WARNING] Comments in CSS use "/* ... */" instead of "//" [plugin angular-compiler] [js-comment-in-css]

    angular:styles/component:css;C:/app/debug.component.ts:25:8:
      25 │         // padding: 10px;
         ╵         ~~

It makes no since. We are in SCSS. 1. I just want to toggle a line to view the result. 2. I never want CSS comments /*...*/ in my file or build. Only SCSS comments // which are not js comments. I disallow CSS comments in SCSS because they are in the build and more complex. Anyway...

This is a wrong detection since we are in component inline styles. Therefore handled as bug. But btw: How to mute this warning?

Please provide the environment you discovered this bug in (run ng version)

19.2.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions