Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Created August 29, 2012 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngauthier/3513503 to your computer and use it in GitHub Desktop.
Save ngauthier/3513503 to your computer and use it in GitHub Desktop.
Javascript Lint Lightning Talk

Javascript Lint Lightning Talk

By Nick Gauthier

Viewing

This is a showoff presentation.

bundle
bundle exec showoff serve

Then visit localhost:9000

Or just read the markdown below and pretend the word "!SLIDE" isn't there.

source :rubygems
gem 'showoff'
gem 'gli', '1.6.0'
GEM
remote: http://rubygems.org/
specs:
blankslate (2.1.2.4)
bluecloth (2.2.0)
gli (1.6.0)
json (1.7.5)
nokogiri (1.5.5)
parslet (1.4.0)
blankslate (~> 2.0)
rack (1.4.1)
rack-protection (1.2.0)
rack
showoff (0.7.0)
bluecloth
gli (>= 1.3.2)
json
nokogiri
parslet
sinatra
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
PLATFORMS
ruby
DEPENDENCIES
gli (= 1.6.0)
showoff
a, a:visited, a:active {
color: #444;
text-decoration: none;
}
a:hover {
color: #009fd5;
text-decoration: none;
}
html, body {
font-family: “helvetica neue”, helvetica, arial, sans-serif;
text-rendering: optimizeLegibility;
}
::selection, *::-moz-selection {
background: rgba(0, 0, 0, 0.3);
}
h1 {
color: #111;
margin-bottom: 40px;
}
h2 {
color: #222;
margin-bottom: 40px;
font-weight: normal;
}
h3 {
color: #222;
margin-bottom: 15px;
font-weight: normal;
}
.content > pre {
font-size: 26px;
line-height: 32px;
}
{
"name": "JSL + CI",
"sections": [
{"section":"slides"}
]
}

!SLIDE

JSL + CI

Nick Gauthier

!SLIDE

Generic: jsl

  • brew install jsl
  • Linux: compile from source or use ppa:team-mayhem/ppa

!SLIDE

jsl

  • jsl.conf file
  • jsl -conf jsl.conf -process my_file.js
  • See Backbone's jsl.conf for a good example

!SLIDE

jsl

@@@ text
backbone.js(471): warning: redeclaration of var attr
      for (var attr in changes) {
...............^

!SLIDE

jsl

Put it in a makefile

!SLIDE

node.js: jslint

  • npm install jslint
  • or add to package.json

!SLIDE

jslint

  • jslint my_file.js
  • Add to Cakefile

!SLIDE

jslint

@@@ text
 #4 Missing 'use strict' statement.
    var root = this; // Line 15, Pos 3

!SLIDE

Ruby (gasp): jslint

Or jslint_on_rails

!SLIDE

Rails + Asset Pipeline

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