XhmikosR / find-unused-sass-variables

A simple tool to find unused Sass variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exit code (v0.4.0)

ashfahan opened this issue · comments

Shouldn't the script generate error when some unused variable is found ?

Spec :
Using Npm version

Expected behavior (0.3.3):
0 3 3

v0.4.0 behavior:
4 0

Hmm, must have broken in the latest patch.

/CC @Johann-S: can you have a look please? Maybe we should check the exit code in tests to prevent this from happening again?

Maybe add process.exit(1); in else statement?

if (unusedList.length === 0) {
spinner.succeed('No unused variables found!');
}

Probably the exit code should be the number of unused variables found.

how about something like ? 😄

} else {
      spinner.fail(`${unusedList.length} unsed variables found !`);
      process.exit(1);
}

I agree with @ashfahan we should use process.exit and yes I think it's due to the move to commander