Just when I wanted to push to production: 104 lines of errors that I had never seen before. That's how I met ESLint.
I had been re-coding my first SaaS, DebateTrend, from Express to Next.js because I thought it would be a good learning experience and I also
wanted to move it to a full-stack framework with more built-in features.
So after I had re-coded everything I decided there was no better time to move to production. That's exactly what I did. I pushed my code to GitHub expecting everything to go flawlessly and for the magic to happen in Vercel, but…
"Build failed"
I was incredibly confused. It ran perfectly fine when I tried it locally (famous last words). After a quick Google search, of the errors I was getting in the logs, I realized that I needed to run some kind of a command.
Since I was new to Next.js I hadn't run "npm run build" at all. I didn't know that it checks if the application is production-ready and activates ESLint powers.
Honestly, I didn't even know what ESLint was. All I had heard from it were some memes, from which I got an idea of what it was about.
So I ran "npm run build" for the first time after 3 weeks of coding and remaking the app…
I had 104 lines of errors.😶
My heart dropped.😱
Imagine my shock when I started googling these issues and finding out most of them were connected to React (a technology I had only started
using the same time I started with Next.js)
That was my warm introduction to ESLint.
It was an even bigger shock when I started fixing the issues with the help of StackOverflow and ChatGPT managing to knock out all of the errors in just 3 hours!
Keep in mind that it was my first time encountering ESLint errors! I'd say I did relatively well!
After refactoring my code to be ESLint compatible I genuinely felt like my code was better and that I had become a better developer.
Here's the article in which I talk about the whole transition from Express to Next.js.
What was your first experience with ESLint?
Thank you for your time and good luck on your journey!
Author Of article : GeorgiMY Read full article