Empty CSS/SCSS files and do Angular problems occur?
Asked Answered
B

2

7

Sonarqube is displaying errors for empty css/scss files in the Angular application. What are the effects of having empty scss files? Do they cause issues with performance, side bugs/errors, future problems, what are the compound negative issues? These are generally leftover when we do ng generate component

Sonarqube flag: Remove this empty stylesheet

Article below states to ignore it, compiler will take care of it, however more interested in the effects of leaving empty files, if there are any. Empty style (.css/.scss) files

Company would have to go through 1000+ empty scss files in large application, interested to know if its worth the time.

Brandabrandais answered 24/11, 2019 at 20:30 Comment(1)
As far as I can tell from looking into this, the best answer is to just leave it. The compiler will indeed handle the empty files appropriately. SonarCube is just picking it up as code smell, empty files should probably be removed to keep a project in its least complex state possible. in the example you gave of a company going through that many files is a complete waste of time.Vanhorn
V
9

As far as I can tell from looking into this, the best answer is to just leave it. The compiler will indeed handle the empty files appropriately.

SonarQube is just picking it up as code smell, empty files should probably be removed to keep a project in its least complex state possible. In the example you gave with a company going through that many files it is a complete waste of time.

Vanhorn answered 25/11, 2019 at 0:52 Comment(0)
R
1

I come from the future and I face the same problem, our solution was to delete the files that were already empty and generate the new components with the --inline-style option, this way no css/scss files are created by default when create the components.

Roseliaroselin answered 24/9, 2022 at 17:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.