Finding unused LESS variables

When developing large less projects it’s a good way to keep the code scaleable and understandable. Maybe you are the only one developing the code, but after some time other developers could dive into your code. A well knowledge of principles like BEM or OOCSS are the fundamental basement.

If you ever developed Java with an IDE you are thankful for the features it provides, like showing unused variables or functions. These features aren’t supported on most of the code editors when coding less (correct me at this point, if I’m wrong). I used sublime text and atom so far for this type of code. Both of them aren’t able to analyze the code for unused variables with the onboard features.

Today I developed a maven project for this reason that is hosted on GitHub. By running the jar file it shows how many times each of the variables in the provided folder and sub folders occur. A count of 1 means that the variable has been initialised, but not used yet.

Link to GitHub

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s