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

By | 2015-12-04T15:14:13+00:00 Dezember 4th, 2015|LESS|0 Comments

About the Author:

Leave A Comment