Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty style (.css/.scss) files

When I create Angular application, I am using CLI for generating components. After certain time of developing app I have style file for every component but major part of them are empty.

When I check sonar I have Code smells in empty style files:

  • Remove this empty stylesheet.
  • Add an empty new line at the end of this file.

Should I remove sonar rules or I must delete all empty style files in project and recreating them in next versions of project when I need them for component styling? What are best practices?

like image 352
Gregor Albert Avatar asked Apr 02 '19 06:04

Gregor Albert


1 Answers

For me, you can let the CSS / SCSS files empty. Just because after the build everything around styling will be minified and contained the "styles.js" file. So, even if it's a bit ugly to see all these empty files in dev mode, the compiler will solve your probelm by itself

this is a screen of your project after build :

enter image description here

like image 180
Hadrien Delphin Avatar answered Sep 29 '22 07:09

Hadrien Delphin