Even for such a small script we took advantage of several rules improving the global readability, the performance and the code convention compliance. Let us review the different violations we dealt with:
|Expected a at column x||BLOCKER||Readability||Help you to indent correctly your code. Very important one.|
|Use “===” instead of “==”||BLOCKER||Performance||Avoid type coersion before comparing. Improves the performance and prevent from tricky errors.|
|Expected exactly one space||MAJOR||Code convention||Encountered between function keyword and list argument essentially.|
|Missing use strict||MAJOR||Code convention||Using strict mode is a good habit.|
|Unexpected space||CRITICAL||Code convention||Good to highlight unnecessary space, especially « invisible » ones at the end of the lines.|
Comments are closed.