SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
21.
KNOW YOUR LINTERS
JSHINT
ESLINT
JSCS
Community-driven JSLint fork. High configurability.
JSHint alternative. High configurability.
Code style checker. Separate and complementary.
WHAT ABOUT JSLINT AND CLOSURE LINTER?
28.
function main(a) {
if (a > 5) {
}
}
COMPLEXITY : 2
29.
function main(a) {
if (a > 5) {
!
} else {
!
}
}
COMPLEXITY : ?
30.
function main(a) {
if (a > 10) {
!
} else if(a > 5) {
!
}
}
COMPLEXITY : 3
31.
function main(a) {
if (a > 5) {
if (a > 10) {
!
}
}
}
COMPLEXITY : 3
32.
function main(a) {
if (a) {
} else if (a) {
}
!
if (other) { }
!
for (var i = 0; i < a; i++) {
if (i % 2) {
} else if (i % 3) {
}
}
}
COMPLEXITY : 7
55.
‣ Code style
‣ Metrics
‣ Build tools
‣ Data formats
‣ Naming conventions
‣ Curly Braces
‣ Directory structure
‣ Everything
ENFORCE
‣ Automate Everything
‣ VCS hooks
‣ CI
‣ Code reviews
‣ Reports
‣ Everything
‣ Warnings === errors
‣ Make it hard to be
wrong
DOCUMENT
‣ Treat docs as code
‣ Make it
‣ easy to find
‣ easy to read
‣ easy to update
‣ easy to discuss
‣ Use github!
AGREE
GET EVERYONE TOGETHER
56.
Your automation choice needs to
accommodate enforcement
57.
Recap
your analysis
your enforcement
your everything
Automate
Automate
Automate