Will Klein

About Me

from Denver

worked on several HUGE codebases

code craftsman

manager

 

3.5 Years Ago

1.5 Years Ago

Convention Tests

Convention Tests, AKA

  • Linters
  • Code analyzers
  • Static analysis

Language

Conventions

What about     our project Conventions?

// Life, Universe, and Everything
var answer = 6 * 7;
// Life, Universe, and Everything
var answer = 6 * 7;
10111010001011011101000101

...

How does this work?

// Life, Universe, and Everything
var answer = 6 * 7;
[var] [answer] [=] [6] [*] [7][;]

...

Tokenize

// Life, Universe, and Everything
var answer = 6 * 7;
[var] [answer] [=] [6] [*] [7][;]

...

...

?

Parse

 

A Syntax Tree

Syntax Tree, AKA

  • Abstract syntax tree
  • AST

ESLint

  • Builds our syntax tree for us
  • Iterates over nodes in the tree
  • For each node, do we have a test?

Anatomy of an ESLint Rule

How Babel Works

How Webpack Works

We Just Learned

  • Syntax trees
  • Syntax analyzers
  • Compilers
  • Code transforms
  • Dependency trees

Building Tools Is for Everyone 

  • Write linting rules
  • Contribute to docs, examples
  • Understand how your engine works
  • Use tools to make your projects better

programs must be written for people to read, and only incidentally for machines to execute

Donald Knuth

Structure and Interpretation of Computer Programs

http://willkle.in

will.klein@gmail.com

Thanks

@willslab

Babel and Webpack and Linters! Oh my!

By Will Klein

Babel and Webpack and Linters! Oh my!

NoCo JS - Mon Oct 3, 2016

  • 2,190