Lint

IanVS

with ESLint

Linting

Static analysis to:

Enforce Style Consistency

Find Errors

Encourage Best Practices

Examples

In JavaScript

// Possible Error

if (x = 0) {
    var b = 1;
}
// Comparison, not Assignment

if (x === 0) {
    var b = 1;
}
// Not Best Practice

if (x == 42) { doSomething() }
// Inconsistent Style

foo = "bar";
x=['baz' ]
// Triple Equals

if (x === 42) { doSomething() }
// Consistent Quotes, Spacing, Semis

foo = "bar";
x = ["baz"];

Benefits

Less Bikeshedding

Better Code Reviews

Fast Failures

Good Linters Are:

Pluggable

Flexible

Comprehensive

176 Included Rules

Style, Bugs, Syntax

On/Off

Rule Options

Warn/Error

Rules

Formatters

Parsers

Questions?

Linting with ESLint

By Ian VanSchooten

Linting with ESLint

A 5 minute introduction to linting and ESLint

  • 1,083