Slide 1

Slide 1 text

Improving  your  code   with  Linter  tools Bruno  Genaro

Slide 2

Slide 2 text

What  is  a  Linter  tool? • Analyses  your  code   • Checks  poten?al  errors   • Bad  habits       • Best  prac?ces     • Consistency  mistakes

Slide 3

Slide 3 text

Why  should  we  use? • Be  familiar  with  best  prac?ces   • Create  our  own  best  prac?ces  and  paBerns   • Consistent  code  across  mul?ple  applica?ons   • Maintainable  code  /  Easy  debug

Slide 4

Slide 4 text

Let’s  talk  about  JavaScript • JSLint  (Douglas  Crockford  -­‐  JavaScript:  The  Good   Parts)   • JSHint  (The  famous  one)   • JSCS   • ESLint  (The  preBy  younger  guy,  good  to  write  ES6)

Slide 5

Slide 5 text

JSHint • Helps  you  to  write  more  reliable  and  consistent  JavaScript   code.     • Checks  your  code  for  a  number  of  common  errors   • Never  forget  a  semicolon  anymore!!!   • Customizable  configura?on  using  .jshintrc  file   • hBp://jshint.com/docs/op?ons/

Slide 6

Slide 6 text

Good  .jshintrc  examples: • Airbnb:  hBps://github.com/airbnb/javascript/blob/ master/linters/jshintrc   • HTML5  Boilerplate:  hBps://github.com/h5bp/ html5boilerplate.com/blob/master/.jshintrc   • Yeoman  Ember.js  Generator:  hBps://github.com/ yeoman/generator-­‐ember/blob/master/.jshintrc   • Bootstrap:  hBps://github.com/twbs/bootstrap/blob/ master/js/.jshintrc

Slide 7

Slide 7 text

Let’s  code  like  a  boss!