From f6951816a05c4d5dcb9259fe7f7a340ea1b17a79 Mon Sep 17 00:00:00 2001 From: etimberg Date: Sat, 13 Feb 2016 20:12:26 -0500 Subject: [PATCH] Improve joshing reporting. Added a JSHint config file. Fixed JSHint warnings. --- config.jshintrc | 4 + dist/Chart.bundle.js | 152 ++++++++++++------------ dist/Chart.js | 152 ++++++++++++------------ gulpfile.js | 5 +- package.json | 3 +- samples/timeScale/line-time-scale.html | 2 +- src/chart.js | 82 ++++++------- src/charts/Chart.Radar.js | 2 +- src/controllers/controller.bar.js | 2 +- src/controllers/controller.bubble.js | 2 +- src/controllers/controller.doughnut.js | 2 +- src/controllers/controller.line.js | 2 +- src/controllers/controller.polarArea.js | 2 +- src/controllers/controller.radar.js | 2 +- src/core/core.animation.js | 2 +- src/core/core.controller.js | 2 +- src/core/core.datasetController.js | 2 +- src/core/core.element.js | 2 +- src/core/core.helpers.js | 4 +- src/core/core.js | 4 +- src/core/core.layoutService.js | 2 +- src/core/core.legend.js | 2 +- src/core/core.scale.js | 2 +- src/core/core.scaleService.js | 2 +- src/core/core.title.js | 2 +- src/core/core.tooltip.js | 2 +- src/elements/element.arc.js | 2 +- src/elements/element.line.js | 2 +- src/elements/element.point.js | 6 +- src/elements/element.rectangle.js | 2 +- src/scales/scale.category.js | 2 +- src/scales/scale.linear.js | 4 +- src/scales/scale.logarithmic.js | 2 +- src/scales/scale.radialLinear.js | 2 +- src/scales/scale.time.js | 6 +- 35 files changed, 238 insertions(+), 232 deletions(-) create mode 100644 config.jshintrc diff --git a/config.jshintrc b/config.jshintrc new file mode 100644 index 000000000..978cc985a --- /dev/null +++ b/config.jshintrc @@ -0,0 +1,4 @@ +{ + "node": true, + "predef": [ "require", "module" ] +} \ No newline at end of file diff --git a/dist/Chart.bundle.js b/dist/Chart.bundle.js index 7e4449189..2f87f7135 100644 --- a/dist/Chart.bundle.js +++ b/dist/Chart.bundle.js @@ -4792,47 +4792,47 @@ window.Color = module.exports = Color */ -var Chart = require('./core/core.js')() - -require('./core/core.helpers')(Chart) -require('./core/core.element')(Chart) -require('./core/core.animation')(Chart) -require('./core/core.controller')(Chart) -require('./core/core.datasetController')(Chart) -require('./core/core.layoutService')(Chart) -require('./core/core.legend')(Chart) -require('./core/core.scale')(Chart) -require('./core/core.scaleService')(Chart) -require('./core/core.title')(Chart) -require('./core/core.tooltip')(Chart) - -require('./controllers/controller.bar')(Chart) -require('./controllers/controller.bubble')(Chart) -require('./controllers/controller.doughnut')(Chart) -require('./controllers/controller.line')(Chart) -require('./controllers/controller.polarArea')(Chart) -require('./controllers/controller.radar')(Chart) - -require('./scales/scale.category')(Chart) -require('./scales/scale.linear')(Chart) -require('./scales/scale.logarithmic')(Chart) -require('./scales/scale.radialLinear')(Chart) -require('./scales/scale.time')(Chart) - -require('./elements/element.arc')(Chart) -require('./elements/element.line')(Chart) -require('./elements/element.point')(Chart) -require('./elements/element.rectangle')(Chart) - -require('./charts/Chart.Bar')(Chart) -require('./charts/Chart.Bubble')(Chart) -require('./charts/Chart.Doughnut')(Chart) -require('./charts/Chart.Line')(Chart) -require('./charts/Chart.PolarArea')(Chart) -require('./charts/Chart.Radar')(Chart) -require('./charts/Chart.Scatter')(Chart) - -window.Chart = module.exports = Chart +var Chart = require('./core/core.js')(); + +require('./core/core.helpers')(Chart); +require('./core/core.element')(Chart); +require('./core/core.animation')(Chart); +require('./core/core.controller')(Chart); +require('./core/core.datasetController')(Chart); +require('./core/core.layoutService')(Chart); +require('./core/core.legend')(Chart); +require('./core/core.scale')(Chart); +require('./core/core.scaleService')(Chart); +require('./core/core.title')(Chart); +require('./core/core.tooltip')(Chart); + +require('./controllers/controller.bar')(Chart); +require('./controllers/controller.bubble')(Chart); +require('./controllers/controller.doughnut')(Chart); +require('./controllers/controller.line')(Chart); +require('./controllers/controller.polarArea')(Chart); +require('./controllers/controller.radar')(Chart); + +require('./scales/scale.category')(Chart); +require('./scales/scale.linear')(Chart); +require('./scales/scale.logarithmic')(Chart); +require('./scales/scale.radialLinear')(Chart); +require('./scales/scale.time')(Chart); + +require('./elements/element.arc')(Chart); +require('./elements/element.line')(Chart); +require('./elements/element.point')(Chart); +require('./elements/element.rectangle')(Chart); + +require('./charts/Chart.Bar')(Chart); +require('./charts/Chart.Bubble')(Chart); +require('./charts/Chart.Doughnut')(Chart); +require('./charts/Chart.Line')(Chart); +require('./charts/Chart.PolarArea')(Chart); +require('./charts/Chart.Radar')(Chart); +require('./charts/Chart.Scatter')(Chart); + +window.Chart = module.exports = Chart; },{"./charts/Chart.Bar":8,"./charts/Chart.Bubble":9,"./charts/Chart.Doughnut":10,"./charts/Chart.Line":11,"./charts/Chart.PolarArea":12,"./charts/Chart.Radar":13,"./charts/Chart.Scatter":14,"./controllers/controller.bar":15,"./controllers/controller.bubble":16,"./controllers/controller.doughnut":17,"./controllers/controller.line":18,"./controllers/controller.polarArea":19,"./controllers/controller.radar":20,"./core/core.animation":21,"./core/core.controller":22,"./core/core.datasetController":23,"./core/core.element":24,"./core/core.helpers":25,"./core/core.js":26,"./core/core.layoutService":27,"./core/core.legend":28,"./core/core.scale":29,"./core/core.scaleService":30,"./core/core.title":31,"./core/core.tooltip":32,"./elements/element.arc":33,"./elements/element.line":34,"./elements/element.point":35,"./elements/element.rectangle":36,"./scales/scale.category":37,"./scales/scale.linear":38,"./scales/scale.logarithmic":39,"./scales/scale.radialLinear":40,"./scales/scale.time":41}],8:[function(require,module,exports){ "use strict"; @@ -4903,7 +4903,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { aspectRatio: 1, @@ -4972,7 +4972,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.bar = { hover: { @@ -5279,7 +5279,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.bubble = { hover: { @@ -5449,7 +5449,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.doughnut = { animation: { @@ -5701,7 +5701,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.line = { showLines: true, @@ -5993,7 +5993,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.polarArea = { @@ -6223,7 +6223,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.radar = { @@ -6431,7 +6431,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.animation = { duration: 1000, @@ -6550,7 +6550,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; //Create a dictionary of chart types, to allow for extension of existing types Chart.types = {}; @@ -7112,7 +7112,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // Base class for all dataset controllers (line, bar, etc) Chart.DatasetController = function(chart, datasetIndex) { @@ -7187,7 +7187,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.elements = {}; @@ -7282,7 +7282,7 @@ module.exports = function(Chart) { /*global document: false */ "use strict"; -var color = require('chartjs-color') +var color = require('chartjs-color'); module.exports = function(Chart) { @@ -8173,7 +8173,7 @@ module.exports = function(Chart) { } }; -} +}; },{"chartjs-color":5}],26:[function(require,module,exports){ "use strict"; @@ -8275,9 +8275,9 @@ module.exports = function() { return text.join(""); } }, - } + }; - return Chart + return Chart; }; @@ -8286,7 +8286,7 @@ module.exports = function() { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // The layout service is very self explanatory. It's responsible for the layout within a chart. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need @@ -8611,7 +8611,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.legend = { @@ -8937,7 +8937,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.scale = { display: true, @@ -9612,7 +9612,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.scaleService = { // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then @@ -9648,7 +9648,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.title = { display: false, @@ -9843,7 +9843,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.tooltips = { enabled: true, @@ -10457,7 +10457,7 @@ module.exports = function(Chart) { module.exports = function(Chart, moment) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.arc = { backgroundColor: Chart.defaults.global.defaultColor, @@ -10540,7 +10540,7 @@ module.exports = function(Chart, moment) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.line = { tension: 0.4, @@ -10703,7 +10703,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.point = { radius: 3, @@ -10765,8 +10765,8 @@ module.exports = function(Chart) { var radius = vm.radius || Chart.defaults.global.elements.point.radius; - var xOffset - var yOffset + var xOffset; + var yOffset; switch (vm.pointStyle) { // Default includes circle @@ -10854,7 +10854,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.rectangle = { backgroundColor: Chart.defaults.global.defaultColor, @@ -10942,7 +10942,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // Default config for a category scale var defaultConfig = { position: "bottom", @@ -10992,7 +10992,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { position: "left", @@ -11076,7 +11076,7 @@ module.exports = function(Chart) { helpers.each(valuesPerType, function(valuesForType) { var values = valuesForType.positiveValues.concat(valuesForType.negativeValues); var minVal = helpers.min(values); - var maxVal = helpers.max(values) + var maxVal = helpers.max(values); this.min = this.min === null ? minVal : Math.min(this.min, minVal); this.max = this.max === null ? maxVal : Math.max(this.max, maxVal); }, this); @@ -11250,7 +11250,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { position: "left", @@ -11444,7 +11444,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { display: true, @@ -11876,12 +11876,12 @@ module.exports = function(Chart) { /*global window: false */ "use strict"; -var moment = require('moment') -moment = typeof(moment) === 'function' ? moment : window.moment +var moment = require('moment'); +moment = typeof(moment) === 'function' ? moment : window.moment; module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; if (!moment) { console.warn('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at http://momentjs.com/'); diff --git a/dist/Chart.js b/dist/Chart.js index ce0d4baf7..dc5973720 100644 --- a/dist/Chart.js +++ b/dist/Chart.js @@ -1598,47 +1598,47 @@ window.Color = module.exports = Color */ -var Chart = require('./core/core.js')() - -require('./core/core.helpers')(Chart) -require('./core/core.element')(Chart) -require('./core/core.animation')(Chart) -require('./core/core.controller')(Chart) -require('./core/core.datasetController')(Chart) -require('./core/core.layoutService')(Chart) -require('./core/core.legend')(Chart) -require('./core/core.scale')(Chart) -require('./core/core.scaleService')(Chart) -require('./core/core.title')(Chart) -require('./core/core.tooltip')(Chart) - -require('./controllers/controller.bar')(Chart) -require('./controllers/controller.bubble')(Chart) -require('./controllers/controller.doughnut')(Chart) -require('./controllers/controller.line')(Chart) -require('./controllers/controller.polarArea')(Chart) -require('./controllers/controller.radar')(Chart) - -require('./scales/scale.category')(Chart) -require('./scales/scale.linear')(Chart) -require('./scales/scale.logarithmic')(Chart) -require('./scales/scale.radialLinear')(Chart) -require('./scales/scale.time')(Chart) - -require('./elements/element.arc')(Chart) -require('./elements/element.line')(Chart) -require('./elements/element.point')(Chart) -require('./elements/element.rectangle')(Chart) - -require('./charts/Chart.Bar')(Chart) -require('./charts/Chart.Bubble')(Chart) -require('./charts/Chart.Doughnut')(Chart) -require('./charts/Chart.Line')(Chart) -require('./charts/Chart.PolarArea')(Chart) -require('./charts/Chart.Radar')(Chart) -require('./charts/Chart.Scatter')(Chart) - -window.Chart = module.exports = Chart +var Chart = require('./core/core.js')(); + +require('./core/core.helpers')(Chart); +require('./core/core.element')(Chart); +require('./core/core.animation')(Chart); +require('./core/core.controller')(Chart); +require('./core/core.datasetController')(Chart); +require('./core/core.layoutService')(Chart); +require('./core/core.legend')(Chart); +require('./core/core.scale')(Chart); +require('./core/core.scaleService')(Chart); +require('./core/core.title')(Chart); +require('./core/core.tooltip')(Chart); + +require('./controllers/controller.bar')(Chart); +require('./controllers/controller.bubble')(Chart); +require('./controllers/controller.doughnut')(Chart); +require('./controllers/controller.line')(Chart); +require('./controllers/controller.polarArea')(Chart); +require('./controllers/controller.radar')(Chart); + +require('./scales/scale.category')(Chart); +require('./scales/scale.linear')(Chart); +require('./scales/scale.logarithmic')(Chart); +require('./scales/scale.radialLinear')(Chart); +require('./scales/scale.time')(Chart); + +require('./elements/element.arc')(Chart); +require('./elements/element.line')(Chart); +require('./elements/element.point')(Chart); +require('./elements/element.rectangle')(Chart); + +require('./charts/Chart.Bar')(Chart); +require('./charts/Chart.Bubble')(Chart); +require('./charts/Chart.Doughnut')(Chart); +require('./charts/Chart.Line')(Chart); +require('./charts/Chart.PolarArea')(Chart); +require('./charts/Chart.Radar')(Chart); +require('./charts/Chart.Scatter')(Chart); + +window.Chart = module.exports = Chart; },{"./charts/Chart.Bar":8,"./charts/Chart.Bubble":9,"./charts/Chart.Doughnut":10,"./charts/Chart.Line":11,"./charts/Chart.PolarArea":12,"./charts/Chart.Radar":13,"./charts/Chart.Scatter":14,"./controllers/controller.bar":15,"./controllers/controller.bubble":16,"./controllers/controller.doughnut":17,"./controllers/controller.line":18,"./controllers/controller.polarArea":19,"./controllers/controller.radar":20,"./core/core.animation":21,"./core/core.controller":22,"./core/core.datasetController":23,"./core/core.element":24,"./core/core.helpers":25,"./core/core.js":26,"./core/core.layoutService":27,"./core/core.legend":28,"./core/core.scale":29,"./core/core.scaleService":30,"./core/core.title":31,"./core/core.tooltip":32,"./elements/element.arc":33,"./elements/element.line":34,"./elements/element.point":35,"./elements/element.rectangle":36,"./scales/scale.category":37,"./scales/scale.linear":38,"./scales/scale.logarithmic":39,"./scales/scale.radialLinear":40,"./scales/scale.time":41}],8:[function(require,module,exports){ "use strict"; @@ -1709,7 +1709,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { aspectRatio: 1, @@ -1778,7 +1778,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.bar = { hover: { @@ -2085,7 +2085,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.bubble = { hover: { @@ -2255,7 +2255,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.doughnut = { animation: { @@ -2507,7 +2507,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.line = { showLines: true, @@ -2799,7 +2799,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.polarArea = { @@ -3029,7 +3029,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.radar = { @@ -3237,7 +3237,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.animation = { duration: 1000, @@ -3356,7 +3356,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; //Create a dictionary of chart types, to allow for extension of existing types Chart.types = {}; @@ -3918,7 +3918,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // Base class for all dataset controllers (line, bar, etc) Chart.DatasetController = function(chart, datasetIndex) { @@ -3993,7 +3993,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.elements = {}; @@ -4088,7 +4088,7 @@ module.exports = function(Chart) { /*global document: false */ "use strict"; -var color = require('chartjs-color') +var color = require('chartjs-color'); module.exports = function(Chart) { @@ -4979,7 +4979,7 @@ module.exports = function(Chart) { } }; -} +}; },{"chartjs-color":6}],26:[function(require,module,exports){ "use strict"; @@ -5081,9 +5081,9 @@ module.exports = function() { return text.join(""); } }, - } + }; - return Chart + return Chart; }; @@ -5092,7 +5092,7 @@ module.exports = function() { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // The layout service is very self explanatory. It's responsible for the layout within a chart. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need @@ -5417,7 +5417,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.legend = { @@ -5743,7 +5743,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.scale = { display: true, @@ -6418,7 +6418,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.scaleService = { // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then @@ -6454,7 +6454,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.title = { display: false, @@ -6649,7 +6649,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.tooltips = { enabled: true, @@ -7263,7 +7263,7 @@ module.exports = function(Chart) { module.exports = function(Chart, moment) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.arc = { backgroundColor: Chart.defaults.global.defaultColor, @@ -7346,7 +7346,7 @@ module.exports = function(Chart, moment) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.line = { tension: 0.4, @@ -7509,7 +7509,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.point = { radius: 3, @@ -7571,8 +7571,8 @@ module.exports = function(Chart) { var radius = vm.radius || Chart.defaults.global.elements.point.radius; - var xOffset - var yOffset + var xOffset; + var yOffset; switch (vm.pointStyle) { // Default includes circle @@ -7660,7 +7660,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; Chart.defaults.global.elements.rectangle = { backgroundColor: Chart.defaults.global.defaultColor, @@ -7748,7 +7748,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; // Default config for a category scale var defaultConfig = { position: "bottom", @@ -7798,7 +7798,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { position: "left", @@ -7882,7 +7882,7 @@ module.exports = function(Chart) { helpers.each(valuesPerType, function(valuesForType) { var values = valuesForType.positiveValues.concat(valuesForType.negativeValues); var minVal = helpers.min(values); - var maxVal = helpers.max(values) + var maxVal = helpers.max(values); this.min = this.min === null ? minVal : Math.min(this.min, minVal); this.max = this.max === null ? maxVal : Math.max(this.max, maxVal); }, this); @@ -8056,7 +8056,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { position: "left", @@ -8250,7 +8250,7 @@ module.exports = function(Chart) { module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; var defaultConfig = { display: true, @@ -8682,12 +8682,12 @@ module.exports = function(Chart) { /*global window: false */ "use strict"; -var moment = require('moment') -moment = typeof(moment) === 'function' ? moment : window.moment +var moment = require('moment'); +moment = typeof(moment) === 'function' ? moment : window.moment; module.exports = function(Chart) { - var helpers = Chart.helpers + var helpers = Chart.helpers; if (!moment) { console.warn('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at http://momentjs.com/'); diff --git a/gulpfile.js b/gulpfile.js index a2568edd1..7b2710983 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -120,8 +120,9 @@ function releaseTask() { function jshintTask() { return gulp.src(srcDir + '**/*.js') - .pipe(jshint()) - .pipe(jshint.reporter('default')); + .pipe(jshint('config.jshintrc')) + .pipe(jshint.reporter('jshint-stylish')) + .pipe(jshint.reporter('fail')); } diff --git a/package.json b/package.json index 6fcb71693..3f3602dcf 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "karma-jasmine-html-reporter": "^0.1.8", "merge-stream": "^1.0.0", "semver": "^3.0.1", - "vinyl-source-stream": "^1.1.0" + "vinyl-source-stream": "^1.1.0", + "jshint-stylish": "~2.1.0" }, "spm": { "main": "Chart.js" diff --git a/samples/timeScale/line-time-scale.html b/samples/timeScale/line-time-scale.html index 0f6210388..8de242b61 100644 --- a/samples/timeScale/line-time-scale.html +++ b/samples/timeScale/line-time-scale.html @@ -3,7 +3,7 @@ Line Chart - +