Added JSHint and JSXHint for linting the code.

This commit is contained in:
Mario Basic
2015-06-18 13:39:47 +02:00
parent 5788f0755d
commit 4c968263f7
27 changed files with 35521 additions and 127 deletions

View File

@@ -1,3 +1,5 @@
/* global chrome */
var config = require('../config');
/**
@@ -6,7 +8,9 @@ var config = require('../config');
*
* @param color
*/
function changeExtensionIcon(color = '') {
function changeExtensionIcon(color) {
color = color ? color : '';
var path = null;
@@ -43,4 +47,4 @@ function changeExtensionIcon(color = '') {
}
export default changeExtensionIcon;
module.exports = changeExtensionIcon;

View File

@@ -10,7 +10,7 @@ var in_array = require('./in_array');
*
* @param state
*/
function changeExtensionState(state){
function changeExtensionState(state) {
if (! in_array(state, config.states)) {
throw new Error('Not a valid state!');
}
@@ -31,4 +31,4 @@ function changeExtensionState(state){
}
}
export default changeExtensionState;
module.exports = changeExtensionState;

View File

@@ -1,3 +1,5 @@
/* global chrome */
var config = require('../config');
/**
@@ -17,4 +19,4 @@ function changeExtensionTooltip(text) {
chrome.browserAction.setTitle({title: text});
}
export default changeExtensionTooltip;
module.exports = changeExtensionTooltip;

View File

@@ -3,8 +3,8 @@
*
* @returns {number}
*/
function currentTimestamp(){
function currentTimestamp() {
return Math.round((new Date()).getTime() / 1000);
}
export default currentTimestamp;
module.exports = currentTimestamp;

View File

@@ -10,4 +10,4 @@ function getDomainFromUrl(url) {
return parts[0] + "//" + parts[2];
}
export default getDomainFromUrl;
module.exports = getDomainFromUrl;

View File

@@ -9,11 +9,10 @@ function in_array(needle, haystack) {
for (var i = 0; i < haystack.length; i ++) {
if (needle == haystack[i]) {
return true;
break;
}
}
return false;
}
export default in_array;
module.exports = in_array;