Commit 7740dcc8 by Anjali Pal

Fix the following rule violations:

* no-throw-literal
* camelcase
* strict
* wrap-iife
* yoda
parent c4092471
...@@ -23,11 +23,6 @@ ...@@ -23,11 +23,6 @@
"global-require" : "off", "global-require" : "off",
"no-shadow" : "off", "no-shadow" : "off",
"dollar-sign/dollar-sign" : "off", "dollar-sign/dollar-sign" : "off",
"no-sequences" : "off", "no-sequences" : "off"
"no-throw-literal" : "off",
"camelcase" : "off",
"strict" : "off",
"wrap-iife" : "off",
"yoda" : "off"
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ require(['bootstrap', ...@@ -7,7 +7,7 @@ require(['bootstrap',
'vendor/domReady!', 'load/init-page', 'vendor/domReady!', 'load/init-page',
'views/data-table-view', 'views/data-table-view',
'views/announcement-view'], 'views/announcement-view'],
function(bootstrap, bootstrap_accessibility, doc, page, DataTableView, AnnouncementView) { function(bootstrap, bootstrapAccessibility, doc, page, DataTableView, AnnouncementView) {
'use strict'; 'use strict';
// Instantiate the announcement view(s) // Instantiate the announcement view(s)
......
...@@ -8,4 +8,5 @@ require([ ...@@ -8,4 +8,5 @@ require([
'load/init-page', 'load/init-page',
'js/application-main' 'js/application-main'
], function() { ], function() {
'use strict';
}); });
...@@ -73,4 +73,4 @@ ...@@ -73,4 +73,4 @@
}); });
}); });
} }
})(); }());
...@@ -164,7 +164,7 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li ...@@ -164,7 +164,7 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li
* (e.g. nvd3.models.lineChart). * (e.g. nvd3.models.lineChart).
*/ */
getChart: function() { getChart: function() {
throw 'Not implemented'; throw 'Not implemented'; // eslint-disable-line no-throw-literal
}, },
/** /**
...@@ -184,8 +184,8 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li ...@@ -184,8 +184,8 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li
/** /**
* Truncate (e.g. add ellipses) long labels shown beneath the bar. * Truncate (e.g. add ellipses) long labels shown beneath the bar.
*/ */
truncateXTick: function(d) { // jshint ignore:line truncateXTick: function() {
throw 'Not implemented'; throw 'Not implemented'; // eslint-disable-line no-throw-literal
}, },
parseXData: function(d) { parseXData: function(d) {
...@@ -268,8 +268,8 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li ...@@ -268,8 +268,8 @@ define(['d3', 'jquery', 'nvd3', 'underscore', 'utils/utils', 'views/attribute-li
* Implement this to enable users to click on chart elements. This * Implement this to enable users to click on chart elements. This
* is called when render is complete and the click option is specified. * is called when render is complete and the click option is specified.
*/ */
addChartClick: function(d) { // jshint ignore:line addChartClick: function() {
throw 'Not implemented'; throw 'Not implemented'; // eslint-disable-line no-throw-literal
}, },
render: function() { render: function() {
......
...@@ -83,11 +83,9 @@ define(['backbone', 'jquery', 'underscore', 'utils/utils'], ...@@ -83,11 +83,9 @@ define(['backbone', 'jquery', 'underscore', 'utils/utils'],
if (_.isUndefined(self.segment)) { if (_.isUndefined(self.segment)) {
// This is taken directly from https://segment.io/docs/tutorials/quickstart-analytics.js/. // This is taken directly from https://segment.io/docs/tutorials/quickstart-analytics.js/.
/* jshint ignore:start */ // eslint-disable-next-line
// jscs:disable
window.analytics = window.analytics || [], window.analytics.methods = ['identify', 'group', 'track', 'page', 'pageview', 'alias', 'ready', 'on', 'once', 'off', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit'], window.analytics.factory = function(t) { return function() { var a = Array.prototype.slice.call(arguments); return a.unshift(t), window.analytics.push(a), window.analytics; }; }; for (var i = 0; i < window.analytics.methods.length; i++) { var key = window.analytics.methods[i]; window.analytics[key] = window.analytics.factory(key); }window.analytics.load = function(t) { if (!document.getElementById('analytics-js')) { var a = document.createElement('script'); a.type = 'text/javascript', a.id = 'analytics-js', a.async = !0, a.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.io/analytics.js/v1/' + t + '/analytics.min.js'; var n = document.getElementsByTagName('script')[0]; n.parentNode.insertBefore(a, n); } }, window.analytics.SNIPPET_VERSION = '2.0.9'; window.analytics = window.analytics || [], window.analytics.methods = ['identify', 'group', 'track', 'page', 'pageview', 'alias', 'ready', 'on', 'once', 'off', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit'], window.analytics.factory = function(t) { return function() { var a = Array.prototype.slice.call(arguments); return a.unshift(t), window.analytics.push(a), window.analytics; }; }; for (var i = 0; i < window.analytics.methods.length; i++) { var key = window.analytics.methods[i]; window.analytics[key] = window.analytics.factory(key); }window.analytics.load = function(t) { if (!document.getElementById('analytics-js')) { var a = document.createElement('script'); a.type = 'text/javascript', a.id = 'analytics-js', a.async = !0, a.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.io/analytics.js/v1/' + t + '/analytics.min.js'; var n = document.getElementsByTagName('script')[0]; n.parentNode.insertBefore(a, n); } }, window.analytics.SNIPPET_VERSION = '2.0.9';
// jscs:enable
/* jshint ignore:end */
// shortcut to segment.io // shortcut to segment.io
self.segment = window.analytics; self.segment = window.analytics;
......
(function () { (function() {
'use strict'; 'use strict';
var eslint = require('gulp-eslint'), var eslint = require('gulp-eslint'),
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
karma.start(extend(defaultOptions, options), cb); karma.start(extend(defaultOptions, options), cb);
} }
gulp.task('lint', function () { gulp.task('lint', function() {
return gulp.src(paths.lint) return gulp.src(paths.lint)
.pipe(eslint()) .pipe(eslint())
.pipe(eslint.format()) .pipe(eslint.format())
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
// this task runs the tests. It doesn't give you very detailed results, // this task runs the tests. It doesn't give you very detailed results,
// so you may need to run the jasmine test page directly: // so you may need to run the jasmine test page directly:
// http://127.0.0.1:8000/static/js/test/spec-runner.html // http://127.0.0.1:8000/static/js/test/spec-runner.html
gulp.task('test', function (cb) { gulp.task('test', function(cb) {
runKarma(paths.karmaConf, cb); runKarma(paths.karmaConf, cb);
}); });
gulp.task('test-debug', function (cb) { gulp.task('test-debug', function(cb) {
runKarma(paths.karmaConf, cb, { runKarma(paths.karmaConf, cb, {
singleRun: false, singleRun: false,
autoWatch: true, autoWatch: true,
...@@ -66,13 +66,13 @@ ...@@ -66,13 +66,13 @@
gulp.task('default', ['test', 'lint']); gulp.task('default', ['test', 'lint']);
// type 'gulp watch' to continuously run linting and tests // type 'gulp watch' to continuously run linting and tests
gulp.task('watch', function () { gulp.task('watch', function() {
gulp.watch(paths.spec, ['test', 'lint']); gulp.watch(paths.spec, ['test', 'lint']);
}); });
// Proxy to django server (assuming that we're using port 8000 and // Proxy to django server (assuming that we're using port 8000 and
// localhost) // localhost)
gulp.task('browser-sync', function () { gulp.task('browser-sync', function() {
// there is a little delay before reloading b/c the sass files need to // there is a little delay before reloading b/c the sass files need to
// recompile, but we can't necessarily watch the generated directory // recompile, but we can't necessarily watch the generated directory
// because django creates a new css file that browser-sync doesn't // because django creates a new css file that browser-sync doesn't
...@@ -84,5 +84,4 @@ ...@@ -84,5 +84,4 @@
reloadDelay: 1000 reloadDelay: 1000
}); });
}); });
}()); }());
Markdown is supported
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