Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

I Wish I Had Linted Before...

DZone's Guide to

I Wish I Had Linted Before...

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

My development process is probably not the same as most folks. As I do a lot of small POCs (proof of concepts) and demos I don't necessarily get that involved in larger projects or code bases. That's one reason I haven't been a big Grunt user yet. Something else that I've not really gotten into is linting. Linting is the process of checking your code for both existing and potential problems. In my mind though I always thought of linting as a best practices tool and while I want my code to be, well, the best, I don't typically worry about it so much when writing a little 20 line program to demonstrate something for a blog article. Heck, sometimes I'll even go out of my way to not do something that is best practice if I think it will get in the way of what I'm trying to explain in the demo/blog post. (As an example, when I teach jQuery I will avoid chaining 3+ calls together at once so as to keep things a bit simpler.)

But a few months ago I noticed something. Your linting tools are actually pretty darn good for pointing out problems. I know, obvious, right? But I didn't realize how often I'd do crap like renaming a function, telling myself I'd remember to update the references later, and then simply forget to do it. Here is a great example. I've got a call to a function I haven't written yet. The fact that my linter has it flagged as an error makes the tool work like a "live" TODO list.

I'm finding myself making much fewer mistakes now that I've started linting everything I write. Even on my small little demos I'm spending less time running into bugs in the browser and getting stuff working right earlier.

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}