Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jimniels committed Dec 30, 2015
1 parent e50aa1b commit 24a3778
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/scripts/data/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uniq, keys } from 'lodash'
import { uniq } from 'lodash'
import epl from './leagues/epl'
import mlb from './leagues/mlb'
import mls from './leagues/mls'
Expand Down Expand Up @@ -87,5 +87,5 @@ module.exports = data


function convertNameToId(name) {
return name.replace(/\s+/g, '-').toLowerCase();
return name.replace(/\s+/g, '-').toLowerCase()
}
3 changes: 1 addition & 2 deletions src/scripts/generateStatic.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Support ES6, React for imported files
require('babel-core/register')({
presets: ['es2015', 'react']
});
})

// Dependencies
var path = require('path')
var fs = require('fs')
var React = require('react')
var ReactDOMServer = require('react-dom/server')
Expand Down
14 changes: 7 additions & 7 deletions src/scripts/utils/debounce.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function debounce(fn, delay) {
var timer = null;
var timer = null
return function () {
var context = this, args = arguments;
clearTimeout(timer);
var context = this, args = arguments
clearTimeout(timer)
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
fn.apply(context, args)
}, delay)
}
}

module.exports = debounce;
module.exports = debounce
10 changes: 5 additions & 5 deletions src/scripts/utils/rgbHexConversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function rgbToHex(rgb){
}

// Return i.e. '34AB32'
return componentToHex(r) + componentToHex(g) + componentToHex(b);
return componentToHex(r) + componentToHex(g) + componentToHex(b)
}

/*
Expand All @@ -30,14 +30,14 @@ export function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
return r + r + g + g + b + b
})

var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
// returns space separated RGB values, i.e. "123 40 51"
return result
? parseInt(result[1], 16) + ' ' +
parseInt(result[2], 16) + ' ' +
parseInt(result[3], 16)
: null;
: null
}

0 comments on commit 24a3778

Please sign in to comment.