Console.log('Hello ESLint!')

13 Feb 2025

Using ESLint and learning about the Airbnb coding style has been somewhat comforting. It has brought more structure to the way I code and has made my files nicer to look at. One example of this is when I have been declaring variables. I often forget that declaring a const is an option. By default, I declare variables using let even if I never reassign them new values. However, it’s a practice in the Airbnb style to use const when a variable won’t change in value.

Practice makes perfect!

I believe that practice and repetition are essential to learning. Being reminded to use “const” over “let” in those cases has drilled it into my mind. I’ve noticed that I now catch myself before typing “let” and think about whether or not the variable will change.

Outside of Javascript conventions, I tend to be inconsistent in code formatting. I often forget to add spaces before brackets and parentheses, but ESLint has taught me to be mindful of that. The strictness of the coding style annoyed me at the start. Extra spaces inside parentheses, between brackets, or even new lines between functions don’t matter when the code gets compiled. If it doesn’t change the function of the code, why should I care?

I realized that readability is equally as important as the functionality of code. While the computer can understand even if my code has back-to-back brackets or parentheses, I can’t. I have a hard time following nested parentheses. Changing my habits with variable declaration and code formatting isn’t major, but ESLint has improved the clarity of my code. Even if my code looks prettier, it doesn’t change the fact that I am prone to error.

Red is an ugly color.

Despite representing love and good luck, to me, red has always meant something was wrong. I hate the red underline that shows up when there is an error in my code. Sometimes I just haven’t hit save in a while. Sometimes I haven’t gotten around to using a variable. Otherwise, I’ve written nonsensical code and need to listen to the warnings.

I hate bugs in real life and code. Both make me uncomfortable because I hate that they’re there and I don’t always know how to get rid of them. Sometimes they’re easy to spot, but more often than not, it’s hard to see them until they become an issue. It’s frustrating how unpredictable bugs can be, whether said bug is crawling along the bathroom wall or breaking my program. I appreciate that ESLint highlights the issues and explains what I did wrong. At least then I can deal with one bug. It’s comforting knowing that when I’m too sleep-deprived to catch my errors, something else will.

Note that this essay was written with the help of Grammarly.