Skip to content

Instantly share code, notes, and snippets.

Last active Dec 28, 2015
What would you like to do?
Eliminate JavaScript Code Smells

Eliminate JavaScript Code Smells


Eliminate JavaScript Code Smells


Deodorize JavaScript Code Smells

Description (unpublished notes)

This talk is intended to go beyond basic linting (JSLint/ESLint/JSHint) techniques and dig further into JavaScript anti-pattern code smells. The gist of the session is to identify common code smells and to introduce patterns to assist when refactoring.

Based on feedback from the first time I gave this talk I created several custom ESLint rules to address many of the smells I identified that weren't already covered by another tool.


Have you ever written JavaScript that worked and passed Lint, but you didn't feel good about it? Maybe you knew it wasn't optimal, but you didn't yet know a better way to write it. We are going to give that code a name... a "code smell".

Your JavaScript may pass standard Lint rules, but that doesn't mean it's Legit.

"A code smell is a surface indication that usually corresponds to a deeper problem in the system" --Martin Fowler

As you progress in your journey as a developer you will find yourself identifying stinky code, but it takes time and training to combat against these smells. It can also be helpful to have proper tooling in place to detect common smells. Code smells scream to be refactored. We will discuss some existing tools and new rules that will help identify numerous smells in your code.

In this session we will look at various code smells and discuss techniques on how we can eliminate and protect against their pungent odors. I will explain the smell, discuss how we can detect it, and identify several ways to deodorize the stench.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment