Skip to content

Commit 6d87dcd

Browse files
committed
Satisfy linter
1 parent 4312ec5 commit 6d87dcd

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

src/core/core.tooltip.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ var exports = Element.extend({
789789
var drawColorBoxes = vm.displayColors;
790790
var xLinePadding = 0;
791791
var colorX = drawColorBoxes ? getAlignedX(vm, 'left') : 0;
792-
792+
793793
var rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);
794794

795795
var fillLineOfText = function(line) {
@@ -862,7 +862,7 @@ var exports = Element.extend({
862862
var footer = vm.footer;
863863
var length = footer.length;
864864
var footerFontSize, i;
865-
865+
866866
if (length) {
867867
var rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);
868868

src/helpers/helpers.rtl.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
11
'use strict';
22

3-
var getRtlAdapter = function (rectX, width) {
3+
var getRtlAdapter = function(rectX, width) {
44
return {
5-
x: function (x) {
5+
x: function(x) {
66
return rectX + rectX + width - x;
77
},
8-
setWidth: function (w) {
8+
setWidth: function(w) {
99
width = w;
1010
},
1111
textAlign: function(align) {
12-
if (align === 'center') return align;
12+
if (align === 'center') {
13+
return align;
14+
}
1315
return align === 'right' ? 'left' : 'right';
1416
},
1517
xPlus: function(x, value) {
1618
return x - value;
1719
},
18-
leftForLtr: function(x, width) {
19-
return x - width;
20+
leftForLtr: function(x, itemWidth) {
21+
return x - itemWidth;
2022
},
2123
};
2224
};
2325

24-
var getLtrAdapter = function () {
26+
var getLtrAdapter = function() {
2527
return {
26-
x: function (x) {
28+
x: function(x) {
2729
return x;
2830
},
29-
setWidth: function (w) {
30-
width = w;
31+
setWidth: function(w) { // eslint-disable-line no-unused-vars
3132
},
3233
textAlign: function(align) {
3334
return align;
3435
},
3536
xPlus: function(x, value) {
3637
return x + value;
3738
},
38-
leftForLtr: function(x, width) {
39+
leftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars
3940
return x;
4041
},
4142
};
4243
};
4344

44-
var getAdapter = function (rtl, rectX, width) {
45+
var getAdapter = function(rtl, rectX, width) {
4546
if (rtl) {
4647
return getRtlAdapter(rectX, width);
47-
} else {
48-
return getLtrAdapter();
4948
}
50-
}
49+
50+
return getLtrAdapter();
51+
};
5152

5253
var overrideTextDirection = function(ctx, direction) {
5354
delete ctx.prevTextDirection;
54-
55+
5556
if (direction === 'ltr' || direction === 'rtl') {
5657
var original = [
5758
ctx.canvas.style.getPropertyValue('direction'),
@@ -64,8 +65,9 @@ var overrideTextDirection = function(ctx, direction) {
6465
};
6566

6667
var restoreTextDirection = function(ctx) {
67-
if (ctx.prevTextDirection === undefined)
68+
if (ctx.prevTextDirection === undefined) {
6869
return;
70+
}
6971

7072
var original = ctx.prevTextDirection;
7173
delete ctx.prevTextDirection;

src/plugins/plugin.legend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ var Legend = Element.extend({
492492
cursor.y += itemHeight;
493493
}
494494
});
495-
495+
496496
helpers.rtl.restoreTextDirection(me.ctx, opts.textDirection);
497497
}
498498
},

0 commit comments

Comments
 (0)