Posted in Miscellaneous

In Soviet Russia, ECMAScript Lints You!

 

I write a fair amount of Javascript for my job, and recently I was reminded that I should really be running eslint against my code to keep it up to our operating standards.  So I ran it against my updates today before I commited them to the repository, and it was a huge PITA to fix all the minor style warnings.  One solution to this would be to use WebStorm like some of the other Excellence Wranglers, since that’s a powerful IDE that can do dynamic linting as the code is written.  But I hate using IDEs.  I know they offer a lot of advantages, but to me nothing beats the simplicity of gvim (or MacVim for OSX).  It’s got a GUI, so I’m not restricted to the terminal, but it has all the strengths of vi, which is my editor of choice.

But lo and behold – Syntastic – a vim plugin that can run any syntax checker, including eslint.  I installed it, and now it lints my code every time I save the file.  The only feature it doesn’t have that I’d like is the ability to automatically fix the errors, but that might be something I can hack in there later, or continue to just run via the command line.  For now it’s enough that I see the problems a few at a time instead of waiting until I have an entire file written without enough spaces in my function calls.

Advertisements

Author:

I'm an Excellence Wrangler at Automattic. I enjoy coffee, and debating who would win in a fight...

One thought on “In Soviet Russia, ECMAScript Lints You!

  1. I hope someone other than family reads your blog. Otherwise absolutely no one will understand what you just wrote.

    On Wed, Jan 20, 2016 at 3:44 PM, Skit Skat Skoodle Doot wrote:

    > Scott Stancil posted: ” I write a fair amount of Javascript for my job, > and recently I was reminded that I should really be running eslint against > my code to keep it up to our operating standards. So I ran it against my > updates today before I commited them to the reposi” >

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s