-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1185 from UziTech/eslint-all-the-things
Eslint all the things
- Loading branch information
Showing
6 changed files
with
74 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,66 @@ | ||
;(function() { | ||
|
||
var console = {} | ||
, files = __TESTS__; | ||
;(function() { | ||
var console = {}, | ||
files = __TESTS__; // eslint-disable-line no-undef | ||
|
||
console.log = function(text) { | ||
var args = Array.prototype.slice.call(arguments, 1) | ||
, i = 0; | ||
console.log = function(text) { | ||
var args = Array.prototype.slice.call(arguments, 1), | ||
i = 0; | ||
|
||
text = text.replace(/%\w/g, function() { | ||
return args[i++] || ''; | ||
}); | ||
text = text.replace(/%\w/g, function() { | ||
return args[i++] || ''; | ||
}); | ||
|
||
if (window.console) window.console.log(text); | ||
document.body.innerHTML += '<pre>' + escape(text) + '</pre>'; | ||
}; | ||
if (window.console) window.console.log(text); | ||
document.body.innerHTML += '<pre>' + escape(text) + '</pre>'; | ||
}; | ||
|
||
if (!Object.keys) { | ||
Object.keys = function(obj) { | ||
var out = [] | ||
, key; | ||
if (!Object.keys) { | ||
Object.keys = function(obj) { | ||
var out = [], | ||
key; | ||
|
||
for (key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
out.push(key); | ||
for (key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
out.push(key); | ||
} | ||
} | ||
} | ||
|
||
return out; | ||
}; | ||
} | ||
|
||
if (!Array.prototype.forEach) { | ||
Array.prototype.forEach = function(callback, context) { | ||
for (var i = 0; i < this.length; i++) { | ||
callback.call(context || null, this[i], i, obj); | ||
} | ||
}; | ||
} | ||
return out; | ||
}; | ||
} | ||
|
||
if (!String.prototype.trim) { | ||
String.prototype.trim = function() { | ||
return this.replace(/^\s+|\s+$/g, ''); | ||
}; | ||
} | ||
if (!Array.prototype.forEach) { | ||
// eslint-disable-next-line no-extend-native | ||
Array.prototype.forEach = function(callback, context) { | ||
for (var i = 0; i < this.length; i++) { | ||
callback.call(context || null, this[i], i, this); | ||
} | ||
}; | ||
} | ||
|
||
function load() { | ||
return files; | ||
} | ||
if (!String.prototype.trim) { | ||
// eslint-disable-next-line no-extend-native | ||
String.prototype.trim = function() { | ||
return this.replace(/^\s+|\s+$/g, ''); | ||
}; | ||
} | ||
|
||
function escape(html, encode) { | ||
return html | ||
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/"/g, '"') | ||
.replace(/'/g, '''); | ||
} | ||
// eslint-disable-next-line no-unused-vars | ||
function load() { | ||
return files; | ||
} | ||
|
||
__LIBS__; | ||
function escape(html, encode) { | ||
return html | ||
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>') | ||
.replace(/"/g, '"') | ||
.replace(/'/g, '''); | ||
} | ||
|
||
(__MAIN__)(); | ||
__LIBS__; // eslint-disable-line no-undef, no-unused-expressions | ||
|
||
(__MAIN__)(); // eslint-disable-line no-undef | ||
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters