Linting

Linting

During our lunch and learn last week I had the privilege of giving a presentation on “Linting.” Why it’s both an educational tool, and a key component in quality focused engineering.” In a nutshell “a linter is a small program that checks code for stylistic or programming errors.” In my opinion it helps with training and skill gaps, is a great evaluation tool during the hiring process, and their use in organizations help attract and retain top talent. They’re also a key code quality metric, and help drive consistency across small and large teams. If you’re building an SOA and not using them, you’re doing it wrong. Why? I will give you one for free... If your coding patterns are consistent it’s easier for people to hop in and out of distributed projects reducing silos. Think efficiency. They also help curb the dreaded home grown DSL that some engineers try to implement for only God knows why. It doesn’t matter if you’re a team of one or Facebook, linters matter. In this presentation I covered rubocop for ruby, eslint for javascript, and stylelint for sass. A rails project can have even more, but those are the core three in my opinion. If you’re not familiar with this technology, I’m happy to help you. If you’re aware of them and refuse to use them, I can’t help you. You’re a lost cause. Sorry not sorry. If you’re just getting started on a project and your goal is “many, many thousands of green people from history times” don’t make the mistake of starting without them. Trust me, adding them later is beyond painful. #qualityfocusedengineering #xp #agiledevelopment #ruby #javascript #sass #collaborate

Jose Galdamez

Principal Software Developer

6 年

The timing of this post is uncanny. I checked ESLint into a small React project just yesterday. While I’ve used linters for years, I started off this one without installing ESLint upfront. I didn’t think it’d be a big deal to add it later since I knew most of the basic rules. Boy, was I wrong. Even though it was a small app of around 20 JS files, getting all the code to pass took me the better part of a day. Most of it was whitespace-related or the result of missing best practices like having PropTypes for type validation. ESLint also caught some bad programming choices I doubt even a human would notice. I did have to change the config to support JSX and ES6 syntax. Aside from that, the setup was pretty trivial. I extend the standard lint rules and don’t change any of the defaults (e.g. keeping tabs at 2 spaces). Visual Studio Code now tells me in real-time if I’m straying from the path. I’ve had other projects where the task runner doesn’t allow a build unless all warnings and errors are patched. That can be more helpful in team environments where everyone has their own style.

Joe Karasek

Lead Engineer and Technical Product Owner | Design Systems at Nike

6 年

Yes yes yes! I’m a huge proponent of a node package called ‘husky’ that adds hooks to npm scripts to the git life cycle. Upon ‘git push’ all linting and tests have to pass. Sounds strict, but a lot of tools like eslint have an autofix flag that takes care of 90% of the work.

要查看或添加评论,请登录

Christopher Hough的更多文章

  • What would Steve or Elon do?

    What would Steve or Elon do?

    Steve Jobs once said “If the object were to have feelings, these would be based on its desire to fulfill its essence…

  • Networking & Outreach

    Networking & Outreach

    I taught another session at Turing this week and I felt it was the best one so far. I love giving back like this, it's…

    5 条评论
  • Moving to Boulder!

    Moving to Boulder!

    OMG! What a biblical journey. What should have taken 2 days, took 5 and all I have to say is fuck U-Haul.

    6 条评论
  • The Boy Scout Rule!

    The Boy Scout Rule!

    The Boy Scouts have a rule, a belief, a moral code they follow regarding campsites. Leave it better for the next camper…

    2 条评论
  • Managing Community

    Managing Community

    I often get asked what are a few of my favorite tools for managing a community. I reply with Slack and Zoom! I have…

  • Learnings #RubyConf2018 DAY THREE

    Learnings #RubyConf2018 DAY THREE

    Today I focused on the “Lead Rubyist” track. [1] “UnLearning - The Challenge of Change” by Jessie Shternshus : Adult…

  • Learnings @ #RubyConf2018 DAY TWO

    Learnings @ #RubyConf2018 DAY TWO

    I focused on the “incident response” and “make it faster” tracks. If you look closely at the image above, the star, you…

  • Learnings @ #RubyConf2018 DAY ONE

    Learnings @ #RubyConf2018 DAY ONE

    [1] Matz’s keynote was amazing. His points about how friendly and welcoming the community is was spot on.

  • An update from the trenches...

    An update from the trenches...

    A few times a year I want to report back on how the Full Stack PDX Meetup is doing… Hard work does not come without…

    5 条评论
  • Goodbye My Friend

    Goodbye My Friend

    On Monday the Go-Cart gets turned into the dealership. It has been an amazing 3 years with this tiny machine! While I…

社区洞察

其他会员也浏览了