Enforce template strings in eslint (#1574)

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
Panu Horsmalahti authored and GitHub committed 2020-11-30 15:35:16 +02:00
1 parent 07e6df9fdc
commit 335778aeef
52 files changed
+94 -88

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ export class PieChart extends React.Component<Props> {
const metaData = Object.values<{ total: number }>(dataset["_meta"])[0];
const percent = Math.round((dataset["data"][tooltipItem["index"]] / metaData.total) * 100);
if (isNaN(percent)) return "N/A";
return percent + "%";
return `${percent}%`;
},
},
filter: ({ datasetIndex, index }, { datasets }) => {
@@ -46,10 +46,10 @@ export const ZebraStripes = {
if (this.getStripesElem(chart)) return;
cover.className = "zebra-cover";
styles.width = right - left + "px";
styles.left = left + "px";
styles.top = top + "px";
styles.height = bottom - top + "px";
styles.width = `${right - left}px`;
styles.left = `${left}px`;
styles.top = `${top}px`;
styles.height = `${bottom - top}px`;
styles.backgroundImage = `
repeating-linear-gradient(to right, ${stripeColor} 0px, ${stripeColor} ${stripeWidth}px,
transparent ${stripeWidth}px, transparent ${stripeWidth * 2 + step}px)
@@ -89,7 +89,7 @@ export const ZebraStripes = {
if (minutes > 0) {
// Move position regarding to difference in time
const cover = this.getStripesElem(chart);
cover.style.backgroundPositionX = -step * minutes + "px";
cover.style.backgroundPositionX = `${-step * minutes}px`;
}
}
};