I have a Sublimelinter installed in Sublime Text 2 and it\'s great. However it doesn\'t like the following code:
if(condition){
var result = 1;
}else{
I recommend doing this:
var result = MORE_LIKELY_OUTCOME;
if (LESS_LIKELY_CONDITION) {
result = LESS_LIKELY_OUTCOME;
}
process(result);
This way, you are setting result initially to what you are expecting it to be most of the times.
Then, the if
statement will change result if the condition occurs.