Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created September 11, 2012 14:34
Show Gist options
  • Save commuterjoy/3699162 to your computer and use it in GitHub Desktop.
Save commuterjoy/3699162 to your computer and use it in GitHub Desktop.
js hint errors
errors found in common.js:
Trailing whitespace. (line: 6, character: 56)
> return bonzo(qwery(selector, context));
Missing semicolon. (line: 10, character: 6)
> }
'define' is not defined. (line: 1, character: 1)
> define(["vendor/EventEmitter-3.1.5", "bonzo", "qwery"], function(placeholder, bonzo, qwery) {
'EventEmitter' is not defined. (line: 3, character: 23)
> mediator: new EventEmitter(),
errors found in article.js:
Trailing whitespace. (line: 4, character: 49)
> 'modules/navigation/top-stories.js',
Trailing whitespace. (line: 5, character: 51)
> 'modules/navigation/controls.js'],
Trailing whitespace. (line: 31, character: 40)
> if (!hasStoryPackage) {
Missing semicolon. (line: 49, character: 19)
> })
Missing semicolon. (line: 65, character: 68)
> var cs = new Clickstream({ filter: ["a", "span"] })
Missing semicolon. (line: 77, character: 10)
> }
Trailing whitespace. (line: 86, character: 32)
> modules.showTabs();
Trailing whitespace. (line: 87, character: 50)
> modules.transcludeNavigation(config);
Trailing whitespace. (line: 88, character: 51)
> modules.loadOmnitureAnalytics(config);
Trailing whitespace. (line: 89, character: 80)
> modules.loadFonts(config, navigator.userAgent, guardian.userPrefs);
Trailing whitespace. (line: 90, character: 48)
> modules.loadOphanAnalytics(config);
Missing semicolon. (line: 92, character: 6)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'modules/related', 'modules/images', 'modules/popular', 'modules/expandable',
'modules' is not defined. (line: 10, character: 7)
> modules = {
'require' is not defined. (line: 70, character: 17)
> require(['http://s.ophan.co.uk/js/t6.min.js'], function(ophan){});
'modules' is not defined. (line: 81, character: 13)
> modules.upgradeImages();
'modules' is not defined. (line: 82, character: 13)
> modules.transcludeRelated(config.page.coreNavigationUrl, config.page.pageId);
'modules' is not defined. (line: 83, character: 13)
> modules.transcludeMostPopular(config.page.coreNavigationUrl, config.page.section);
'modules' is not defined. (line: 84, character: 13)
> modules.showRelativeDates();
'modules' is not defined. (line: 85, character: 13)
> modules.showTabs();
'modules' is not defined. (line: 86, character: 13)
> modules.showTabs();
'modules' is not defined. (line: 87, character: 13)
> modules.transcludeNavigation(config);
'modules' is not defined. (line: 88, character: 13)
> modules.loadOmnitureAnalytics(config);
'modules' is not defined. (line: 89, character: 13)
> modules.loadFonts(config, navigator.userAgent, guardian.userPrefs);
'guardian' is not defined. (line: 89, character: 60)
> modules.loadFonts(config, navigator.userAgent, guardian.userPrefs);
'modules' is not defined. (line: 90, character: 13)
> modules.loadOphanAnalytics(config);
errors found in detect.js:
'getLayoutMode' is a function. (line: 25, character: 9)
> getLayoutMode = function() {
'ua' is already defined. (line: 78, character: 16)
> var ua = ua.toLowerCase(),
'define' is not defined. (line: 8, character: 1)
> define(function () {
'ns' is not defined. (line: 91, character: 9)
> ns = {'svg': 'http://www.w3.org/2000/svg'};
'ns' is not defined. (line: 92, character: 73)
> return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
errors found in expandable.js:
Trailing whitespace. (line: 1, character: 68)
> define(['common', 'vendor/bean-0.4.11-1'], function(common, bean) {
Trailing whitespace. (line: 12, character: 16)
> // View
Trailing whitespace. (line: 22, character: 77)
> (expanded) ? dom.removeClass('shut') : dom.addClass('shut');
Expected an assignment or function call and instead saw an expression. (line: 22, character: 75)
> (expanded) ? dom.removeClass('shut') : dom.addClass('shut');
Missing semicolon. (line: 33, character: 10)
> }
Missing semicolon. (line: 41, character: 90)
> common.mediator.emit('modules:expandable:expandedChange:' + id, expanded)
Missing semicolon. (line: 45, character: 46)
> return dom.attr('data-count')
Trailing whitespace. (line: 48, character: 33)
> isOpen: function() {
Missing semicolon. (line: 51, character: 10)
> }
Trailing whitespace. (line: 58, character: 14)
> }
Trailing whitespace. (line: 61, character: 40)
> view.renderState(expanded);
Missing semicolon. (line: 62, character: 10)
> }
Trailing whitespace. (line: 76, character: 22)
> return Expandable
Missing semicolon. (line: 74, character: 6)
> }
Missing semicolon. (line: 76, character: 22)
> return Expandable
'define' is not defined. (line: 1, character: 1)
> define(['common', 'vendor/bean-0.4.11-1'], function(common, bean) {
errors found in fonts.js:
Mixed spaces and tabs. (line: 6, character: 4)
> this.fileFormat = fileFormat;
Mixed spaces and tabs. (line: 10, character: 8)
> // A final check for localStorage.
Mixed spaces and tabs. (line: 11, character: 8)
> // Because it would be horrible if people downloaded fonts and then couldn't cache them.
Mixed spaces and tabs. (line: 12, character: 8)
> try {
Mixed spaces and tabs. (line: 13, character: 8)
> localStorage.setItem('test', 'test1');
Mixed spaces and tabs. (line: 14, character: 8)
> localStorage.removeItem('test');
Mixed spaces and tabs. (line: 15, character: 8)
> return (localStorage.getItem(Fonts.storagePrefix + style.getAttribute('data-cache-name')) === null);
Mixed spaces and tabs. (line: 16, character: 8)
> }
Mixed spaces and tabs. (line: 17, character: 8)
> catch(e) {
Mixed spaces and tabs. (line: 18, character: 8)
> return false;
Mixed spaces and tabs. (line: 19, character: 8)
> }
Mixed spaces and tabs. (line: 24, character: 8)
> // If no URL, then load from standard static assets path.
Mixed spaces and tabs. (line: 25, character: 8)
> var url = url || '';
'url' is already defined. (line: 25, character: 21)
> var url = url || '';
Mixed spaces and tabs. (line: 28, character: 12)
> var style = this.styleNodes[i];
Mixed spaces and tabs. (line: 30, character: 12)
> this.reqwest({
Mixed spaces and tabs. (line: 31, character: 1)
> url: url + style.getAttribute('data-cache-file-' + this.fileFormat),
Mixed spaces and tabs. (line: 32, character: 1)
> type: 'jsonp',
Mixed spaces and tabs. (line: 33, character: 1)
> jsonpCallbackName: 'guFont',
Mixed spaces and tabs. (line: 34, character: 1)
> success: (function(style) {
Mixed spaces and tabs. (line: 35, character: 1)
> return function(json) {
Mixed spaces and tabs. (line: 36, character: 1)
> if (typeof callback === 'function') {
Mixed spaces and tabs. (line: 37, character: 1)
> callback(style, json);
Mixed spaces and tabs. (line: 38, character: 1)
> }
Mixed spaces and tabs. (line: 39, character: 1)
> localStorage.setItem(Fonts.storagePrefix + style.getAttribute('data-cache-name'), json.css);
Mixed spaces and tabs. (line: 40, character: 1)
> common.mediator.emit('modules:fonts:loaded', [json.name]);
Mixed spaces and tabs. (line: 41, character: 1)
> }
Mixed spaces and tabs. (line: 42, character: 1)
> })(style)
Missing semicolon. (line: 41, character: 30)
> }
Don't make functions within a loop. (line: 42, character: 26)
> })(style)
Move the invocation into the parens that contain the function. (line: 42, character: 27)
> })(style)
Mixed spaces and tabs. (line: 43, character: 12)
> });
Mixed spaces and tabs. (line: 44, character: 12)
> } else {
Mixed spaces and tabs. (line: 45, character: 12)
> common.mediator.emit('modules:fonts:notloaded', []);
Mixed spaces and tabs. (line: 46, character: 12)
> }
Missing semicolon. (line: 48, character: 10)
> }
Mixed spaces and tabs. (line: 51, character: 8)
> var html = document.querySelector('html');
Mixed spaces and tabs. (line: 52, character: 8)
> this.loadFromServer(url, function(style, json) {
Mixed spaces and tabs. (line: 53, character: 8)
> style.innerHTML = json.css;
Mixed spaces and tabs. (line: 54, character: 8)
> if (html.className.indexOf('font-' + json.name + '-loaded') < 0) {
Mixed spaces and tabs. (line: 55, character: 8)
> html.className += ' font-' + json.name + '-loaded';
Mixed spaces and tabs. (line: 56, character: 8)
> }
Mixed spaces and tabs. (line: 57, character: 8)
> });
Missing semicolon. (line: 58, character: 10)
> }
Missing semicolon. (line: 72, character: 6)
> }
'define' is not defined. (line: 1, character: 1)
> define(['reqwest', 'common'], function(reqwest, common) {
errors found in images.js:
Missing semicolon. (line: 29, character: 10)
> }
Missing semicolon. (line: 41, character: 10)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'modules/detect'], function (common, detect) {
errors found in popular.js:
Trailing whitespace. (line: 1, character: 57)
> define(['common', 'reqwest'], function(common, reqwest){
Trailing whitespace. (line: 5, character: 16)
> // View
Missing semicolon. (line: 13, character: 63)
> common.mediator.emit('modules:popular:render')
Missing semicolon. (line: 16, character: 10)
> }
Missing semicolon. (line: 31, character: 84)
> common.mediator.emit('modules:popular:loaded', [json.html])
Trailing whitespace. (line: 34, character: 10)
> }
Missing semicolon. (line: 33, character: 15)
> })
Missing semicolon. (line: 34, character: 10)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'reqwest'], function(common, reqwest){
errors found in related.js:
Trailing whitespace. (line: 1, character: 57)
> define(['common', 'reqwest'], function(common, reqwest){
Trailing whitespace. (line: 5, character: 16)
> // View
Missing semicolon. (line: 12, character: 10)
> }
Missing semicolon. (line: 25, character: 80)
> common.mediator.emit('modules:related:loaded', [json.html])
Trailing whitespace. (line: 28, character: 10)
> }
Missing semicolon. (line: 28, character: 10)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'reqwest'], function(common, reqwest){
errors found in relativedates.js:
Missing semicolon. (line: 12, character: 36)
> return n < 10 ? '0' + n : n
Missing semicolon. (line: 16, character: 36)
> return n < 12 ? 'am' : 'pm'
Expected '===' and instead saw '=='. (line: 25, character: 37)
> return (date.toDateString() == today.toDateString());
Expected '===' and instead saw '=='. (line: 32, character: 41)
> return (relative.toDateString() == yesterday.toDateString());
Trailing whitespace. (line: 36, character: 72)
> if ( Object.prototype.toString.call(date) !== "[object Date]" )
Expected '{' and instead saw 'return'. (line: 37, character: 13)
> return false;
Missing radix parameter. (line: 49, character: 21)
> var delta = parseInt((now.getTime() - then) / 1000);
Missing radix parameter. (line: 62, character: 18)
> (parseInt(delta / 60)).toString() +
Missing radix parameter. (line: 66, character: 21)
> return (parseInt(delta / 60)).toString() +
Trailing whitespace. (line: 69, character: 38)
> } else if (delta < (90*60)) {
Trailing whitespace. (line: 72, character: 40)
> } else if (delta < (5*60*60)) {
Trailing whitespace. (line: 77, character: 36)
> } else if (isToday(then)) {
Trailing whitespace. (line: 84, character: 53)
> } else if (isYesterday(then)) { // yesterday
Trailing whitespace. (line: 91, character: 61)
> } else if (delta < 5*24*60*60) { // less than 5 days
Missing semicolon. (line: 89, character: 38)
> ampm(then.getHours())
Missing semicolon. (line: 135, character: 6)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common'], function (common) {
errors found in tabs.js:
Expected '===' and instead saw '=='. (line: 58, character: 37)
> if (target.nodeType == 3) {
Missing semicolon. (line: 83, character: 15)
> })
'define' is not defined. (line: 1, character: 1)
> define(['common', 'vendor/bean-0.4.11-1', 'bonzo', 'qwery'], function (common, bean, bonzo, qwery) {
errors found in clickstream.js:
'opts' is already defined. (line: 5, character: 18)
> var opts = opts || {},
Expected '===' and instead saw '=='. (line: 10, character: 27)
> return (f == element);
Missing semicolon. (line: 12, character: 10)
> }
Expected a conditional expression and instead saw an assignment. (line: 22, character: 30)
> if (dataLinkName = element.getAttribute("data-link-name")) {
Missing semicolon. (line: 27, character: 10)
> }
Confusing use of '!'. (line: 32, character: 17)
> if (!filterSource(event.target.tagName.toLowerCase()).length > 0) {
Missing semicolon. (line: 46, character: 6)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'modules/detect', 'vendor/bean-0.4.11-1'], function(common, detect, bean) {
'dataLinkName' is not defined. (line: 22, character: 17)
> if (dataLinkName = element.getAttribute("data-link-name")) {
'dataLinkName' is not defined. (line: 23, character: 26)
> tag.push(dataLinkName);
errors found in omniture.js:
'config' is already defined. (line: 7, character: 20)
> var config = config,
's' is already defined. (line: 8, character: 15)
> s = s,
Missing semicolon. (line: 13, character: 10)
> }
Missing semicolon. (line: 25, character: 10)
> }
Missing semicolon. (line: 32, character: 10)
> }
Missing semicolon. (line: 74, character: 10)
> }
Trailing whitespace. (line: 84, character: 41)
> // use the global 's' object
Expected '!==' and instead saw '!='. (line: 86, character: 19)
> if (s != null) {
Missing semicolon. (line: 89, character: 77)
> common.mediator.on('module:clickstream:click', that.logTag )
Trailing whitespace. (line: 92, character: 34)
> s = window.s;
Missing semicolon. (line: 95, character: 81)
> common.mediator.on('module:clickstream:click', that.logTag )
Trailing whitespace. (line: 98, character: 10)
> }
Missing semicolon. (line: 98, character: 10)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'modules/detect', 'vendor/bean-0.4.11-1'], function(common, detect, bean) {
's_account' is not defined. (line: 79, character: 13)
> s_account = config.page.omnitureAccount;
'require' is not defined. (line: 91, character: 17)
> require(['omniture'], function(placeholder){
errors found in controls.js:
Trailing whitespace. (line: 1, character: 84)
> define(['common', 'vendor/bean-0.4.11-1', 'bonzo'], function(common, Bean, bonzo) {
'label' is already defined. (line: 4, character: 19)
> var label = document.createElement('div'),
Missing semicolon. (line: 6, character: 6)
> }
Expected '===' and instead saw '=='. (line: 18, character: 66)
> var item = bonzo(document.getElementById(((state == "sections") ? "sections-" + position : "topstories-" + position)));
Expected '===' and instead saw '=='. (line: 19, character: 69)
> var altItem = bonzo(document.getElementById(((state == "sections") ? "topstories-" + position : "sections-" + position)));
Missing semicolon. (line: 31, character: 31)
> return (state)
Trailing whitespace. (line: 42, character: 39)
> view.hideBottomMenu();
Trailing whitespace. (line: 44, character: 82)
> // can't seem to get bean to bind on arrays of elements properly,
Missing semicolon. (line: 74, character: 10)
> }
Missing semicolon. (line: 79, character: 10)
> }
Missing semicolon. (line: 82, character: 24)
> view.init()
Missing semicolon. (line: 83, character: 10)
> }
Trailing whitespace. (line: 87, character: 22)
> return Navigation
Missing semicolon. (line: 84, character: 6)
> }
Missing semicolon. (line: 87, character: 22)
> return Navigation
'define' is not defined. (line: 1, character: 1)
> define(['common', 'vendor/bean-0.4.11-1', 'bonzo'], function(common, Bean, bonzo) {
errors found in top-stories.js:
Trailing whitespace. (line: 1, character: 73)
> define(['common', 'reqwest', 'bonzo'], function(common, reqwest, bonzo){
Trailing whitespace. (line: 5, character: 16)
> // View
Missing semicolon. (line: 23, character: 66)
> common.mediator.emit('modules:navigation:render')
Missing semicolon. (line: 26, character: 10)
> }
Missing semicolon. (line: 43, character: 87)
> common.mediator.emit('modules:navigation:loaded', [json.html])
Trailing whitespace. (line: 46, character: 10)
> }
Missing semicolon. (line: 45, character: 15)
> })
Missing semicolon. (line: 46, character: 10)
> }
'define' is not defined. (line: 1, character: 1)
> define(['common', 'reqwest', 'bonzo'], function(common, reqwest, bonzo){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment