Skip to content
Snippets Groups Projects
Commit a32fd27d authored by Brian Jacobel's avatar Brian Jacobel
Browse files

Replace JSHint ignore directives with ESLint ones

parent 8582da4a
No related merge requests found
Showing
with 62 additions and 38 deletions
{
"extends": "eslint-config-edx"
"extends": "eslint-config-edx",
"globals": { // Try to avoid adding any new globals.
// Old compatibility things and hacks
"edx": true,
"XBlock": true,
// added by Django i18n tools
"gettext": true,
"ngettext": true,
// added by jasmine-jquery
"loadFixtures": true,
"appendLoadFixtures": true,
"readFixtures": true,
"setFixtures": true,
"appendSetFixtures": true,
"spyOnEvent": true,
// used by our requirejs implementation
"RequireJS": true
}
}
/* globals AjaxPrefix */
(function(AjaxPrefix) {
'use strict';
define(['domReady', 'jquery', 'underscore.string', 'backbone', 'gettext',
......@@ -34,7 +36,7 @@
message = str.truncate(jqXHR.responseText, 300);
}
} else {
message = gettext('This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.'); //jshint ignore:line
message = gettext('This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.'); // eslint-disable-line max-len
}
msg = new NotificationView.Error({
'title': gettext("Studio's having trouble saving your work"),
......@@ -65,5 +67,4 @@
main();
return main;
});
}).call(this, AjaxPrefix); //jshint ignore:line
}).call(this, AjaxPrefix);
......@@ -94,7 +94,7 @@
// end of Annotation tool files
// externally hosted files
'mathjax': '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // jshint ignore:line
mathjax: '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': [
// youtube URL does not end in '.js'. We add '?noext' to the path so
// that require.js adds the '.js' to the query component of the URL,
......
/* globals requirejs, requireSerial */
(function(requirejs, requireSerial) {
'use strict';
......@@ -22,9 +24,9 @@
'jquery.cookie': 'xmodule_js/common_static/js/vendor/jquery.cookie',
'jquery.qtip': 'xmodule_js/common_static/js/vendor/jquery.qtip.min',
'jquery.fileupload': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload',
'jquery.fileupload-process': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process', // jshint ignore:line
'jquery.fileupload-validate': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate', // jshint ignore:line
'jquery.iframe-transport': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport', // jshint ignore:line
'jquery.fileupload-process': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process', // eslint-disable-line max-len
'jquery.fileupload-validate': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate', // eslint-disable-line max-len
'jquery.iframe-transport': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport', // eslint-disable-line max-len
'jquery.inputnumber': 'xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill',
'jquery.immediateDescendents': 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents',
'jquery.simulate': 'xmodule_js/common_static/js/vendor/jquery.simulate',
......@@ -54,7 +56,7 @@
'domReady': 'xmodule_js/common_static/js/vendor/domReady',
'URI': 'xmodule_js/common_static/js/vendor/URI.min',
'mock-ajax': 'xmodule_js/common_static/js/vendor/mock-ajax',
'mathjax': '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // jshint ignore:line
mathjax: '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': '//www.youtube.com/player_api?noext',
'coffee/src/ajax_prefix': 'xmodule_js/common_static/coffee/src/ajax_prefix',
'js/spec/test_utils': 'js/spec/test_utils'
......@@ -290,5 +292,4 @@
requireSerial(specHelpers.concat(testFiles), function() {
return window.__karma__.start();
});
}).call(this, requirejs, requireSerial); // jshint ignore:line
}).call(this, requirejs, requireSerial);
/* globals sandbox */
(function(sandbox) {
'use strict';
require(["jquery", "backbone", "cms/js/main", "edx-ui-toolkit/js/utils/spec-helpers/ajax-helpers", "jquery.cookie"],
......@@ -77,5 +79,4 @@
});
});
});
}).call(this, sandbox); //jshint ignore:line
}).call(this, sandbox);
/* globals requirejs, requireSerial */
(function(requirejs, requireSerial) {
'use strict';
......@@ -21,9 +23,9 @@
'jquery.cookie': 'xmodule_js/common_static/js/vendor/jquery.cookie',
'jquery.qtip': 'xmodule_js/common_static/js/vendor/jquery.qtip.min',
'jquery.fileupload': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload',
'jquery.fileupload-process': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process', // jshint ignore:line
'jquery.fileupload-validate': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate', // jshint ignore:line
'jquery.iframe-transport': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport', // jshint ignore:line
'jquery.fileupload-process': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process', // eslint-disable-line max-len
'jquery.fileupload-validate': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate', // eslint-disable-line max-len
'jquery.iframe-transport': 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport', // eslint-disable-line max-len
'jquery.inputnumber': 'xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill',
'jquery.immediateDescendents': 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents',
'datepair': 'xmodule_js/common_static/js/vendor/timepicker/datepair',
......@@ -46,7 +48,7 @@
'draggabilly': 'xmodule_js/common_static/js/vendor/draggabilly',
'domReady': 'xmodule_js/common_static/js/vendor/domReady',
'URI': 'xmodule_js/common_static/js/vendor/URI.min',
'mathjax': '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // jshint ignore:line
mathjax: '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // eslint-disable-line max-len
'youtube': '//www.youtube.com/player_api?noext',
'coffee/src/ajax_prefix': 'xmodule_js/common_static/coffee/src/ajax_prefix'
},
......@@ -206,5 +208,4 @@
requireSerial(specHelpers.concat(testFiles), function() {
return window.__karma__.start();
});
}).call(this, requirejs, requireSerial); // jshint ignore:line
}).call(this, requirejs, requireSerial);
// Backbone.js Application Collection: Certificates
define([ // jshint ignore:line
define([
'backbone',
'gettext',
'js/certificates/models/certificate'
......
// Backbone.js Application Collection: Certificate Signatories
define([ // jshint ignore:line
define([
'backbone',
'js/certificates/models/signatory'
],
......
......@@ -11,7 +11,7 @@ The RequireJS Optimizer is only enabled in Studio at present, so the page factor
We do intend to enable page factories on the LMS too.
*/
define([ // jshint ignore:line
define([
'jquery',
'js/certificates/collections/certificates',
'js/certificates/models/certificate',
......
// Backbone.js Application Model: Certificate Signatory
define([ // jshint ignore:line
define([
'underscore',
'backbone',
'backbone-relational'
......
// Custom matcher library for Jasmine test assertions
// http://tobyho.com/2012/01/30/write-a-jasmine-matcher/
define(['jquery'], function($) { // jshint ignore:line
define(['jquery'], function($) { // eslint-disable-line no-unused-vars
'use strict';
return function () {
jasmine.addMatchers({
......
// Jasmine Test Suite: Certifiate Model
define([ // jshint ignore:line
define([
'js/certificates/models/certificate',
'js/certificates/collections/certificates'
],
......
// Jasmine Test Suite: Certifiate Details View
define([ // jshint ignore:line
define([
'underscore',
'js/models/course',
'js/certificates/collections/certificates',
......@@ -104,7 +104,7 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
model: this.model
});
appendSetFixtures(this.view.render().el);
CustomMatchers(); // jshint ignore:line
CustomMatchers();
});
afterEach(function() {
......@@ -141,7 +141,7 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
});
it('should have empty certificate collection if there is an error parsing certifcate JSON', function () {
var CERTIFICATE_INVALID_JSON = '[{"course_title": Test certificate course title override, "signatories":"[]"}]'; // jshint ignore:line
var CERTIFICATE_INVALID_JSON = '[{"course_title": Test certificate course title override, "signatories":"[]"}]'; // eslint-disable-line max-len
var collection_length = this.collection.length;
this.collection.parse(CERTIFICATE_INVALID_JSON);
//collection length should remain the same since we have error parsing JSON
......
// Jasmine Test Suite: Certifiate Editor View
define([ // jshint ignore:line
define([
'underscore',
'js/models/course',
'js/certificates/models/certificate',
......@@ -119,7 +119,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
max_signatories_limit: MAX_SIGNATORIES_LIMIT
});
appendSetFixtures(this.view.render().el);
CustomMatchers(); // jshint ignore:line
CustomMatchers();
});
afterEach(function() {
......
// Jasmine Test Suite: Certificate Web Preview
define([ // jshint ignore:line
define([
'underscore',
'jquery',
'js/models/course',
......
// Jasmine Test Suite: Certificate List View
define([ // jshint ignore:line
define([
'underscore',
'js/models/course',
'js/certificates/collections/certificates',
......@@ -61,7 +61,7 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
collection: this.collection
});
appendSetFixtures(this.view.render().el);
CustomMatchers(); // jshint ignore:line
CustomMatchers();
});
afterEach(function() {
......
// Backbone Application View: Certificate Details
define([ // jshint ignore:line
define([
'jquery',
'underscore',
'underscore.string',
......
// Backbone Application View: Certificate Editor
define([ // jshint ignore:line
define([
'jquery',
'underscore',
'backbone',
......@@ -83,7 +83,7 @@ function($, _, Backbone, gettext,
addSignatory: function() {
// Append a new signatory to the certificate model's signatories collection
var signatory = new SignatoryModel({certificate: this.getSaveableModel()}); // jshint ignore:line
var signatory = new SignatoryModel({certificate: this.getSaveableModel()}); // eslint-disable-line max-len, no-unused-vars
this.render();
},
......
// Backbone Application View: Certificate Item
// Renders an editor view or a details view depending on the state of the underlying model.
define([ // jshint ignore:line
define([
'gettext',
'js/views/list_item',
'js/certificates/views/certificate_details',
......
......@@ -2,7 +2,7 @@
// User can preview the certificate web layout/styles. 'Preview Certificate' button will open a new tab in LMS for
// the selected course mode from the drop down.
define([ // jshint ignore:line
define([
'underscore',
'gettext',
'js/views/baseview',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment