mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint: comma-spacing (error) & comma-dangle (error) (#4200)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
02e77afcd1
commit
c6dce043a7
406 files changed
+1590
-1580
No files matched your search
@@ -38,7 +38,7 @@ interface Props extends ChartProps {
|
||||
|
||||
const defaultProps: Partial<Props> = {
|
||||
timeLabelStep: 10,
|
||||
plugins: [ZebraStripes]
|
||||
plugins: [ZebraStripes],
|
||||
};
|
||||
|
||||
@observer
|
||||
@@ -66,9 +66,9 @@ export class BarChart extends React.Component<Props> {
|
||||
borderWidth: { top: 3 },
|
||||
barPercentage: 1,
|
||||
categoryPercentage: 1,
|
||||
...item
|
||||
...item,
|
||||
};
|
||||
})
|
||||
}),
|
||||
};
|
||||
|
||||
if (chartData.datasets.length == 0) {
|
||||
@@ -104,16 +104,16 @@ export class BarChart extends React.Component<Props> {
|
||||
fontColor: textColorPrimary,
|
||||
fontSize: 11,
|
||||
maxRotation: 0,
|
||||
minRotation: 0
|
||||
minRotation: 0,
|
||||
},
|
||||
bounds: "data",
|
||||
time: {
|
||||
unit: "minute",
|
||||
displayFormats: {
|
||||
minute: "x"
|
||||
minute: "x",
|
||||
},
|
||||
parser: timestamp => moment.unix(parseInt(timestamp))
|
||||
}
|
||||
parser: timestamp => moment.unix(parseInt(timestamp)),
|
||||
},
|
||||
}],
|
||||
yAxes: [{
|
||||
position: "right",
|
||||
@@ -121,16 +121,16 @@ export class BarChart extends React.Component<Props> {
|
||||
color: borderFaintColor,
|
||||
drawBorder: false,
|
||||
tickMarkLength: 0,
|
||||
zeroLineWidth: 0
|
||||
zeroLineWidth: 0,
|
||||
},
|
||||
ticks: {
|
||||
maxTicksLimit: 6,
|
||||
fontColor: textColorPrimary,
|
||||
fontSize: 11,
|
||||
padding: 8,
|
||||
min: 0
|
||||
}
|
||||
}]
|
||||
min: 0,
|
||||
},
|
||||
}],
|
||||
},
|
||||
tooltips: {
|
||||
mode: "index",
|
||||
@@ -147,25 +147,25 @@ export class BarChart extends React.Component<Props> {
|
||||
labelColor: ({ datasetIndex }) => {
|
||||
return {
|
||||
borderColor: "darkgray",
|
||||
backgroundColor: chartData.datasets[datasetIndex].borderColor as string
|
||||
backgroundColor: chartData.datasets[datasetIndex].borderColor as string,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
duration: 0
|
||||
duration: 0,
|
||||
},
|
||||
elements: {
|
||||
rectangle: {
|
||||
backgroundColor: getBarColor.bind(null)
|
||||
}
|
||||
backgroundColor: getBarColor.bind(null),
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
ZebraStripes: {
|
||||
stripeColor: chartStripesColor,
|
||||
interval: chartData.datasets[0].data.length
|
||||
}
|
||||
}
|
||||
interval: chartData.datasets[0].data.length,
|
||||
},
|
||||
},
|
||||
};
|
||||
const options = merge(barOptions, customOptions);
|
||||
|
||||
@@ -200,9 +200,9 @@ export const memoryOptions: ChartOptions = {
|
||||
|
||||
return bytesToUnits(value);
|
||||
},
|
||||
stepSize: 1
|
||||
}
|
||||
}]
|
||||
stepSize: 1,
|
||||
},
|
||||
}],
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
@@ -211,9 +211,9 @@ export const memoryOptions: ChartOptions = {
|
||||
const value = data[index] as ChartPoint;
|
||||
|
||||
return `${label}: ${bytesToUnits(parseInt(value.y.toString()), 3)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Default options for all charts with cpu units or other decimal numbers
|
||||
@@ -229,9 +229,9 @@ export const cpuOptions: ChartOptions = {
|
||||
if (float < 100) return float.toFixed(2);
|
||||
|
||||
return float.toFixed(1);
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
},
|
||||
}],
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
@@ -240,7 +240,7 @@ export const cpuOptions: ChartOptions = {
|
||||
const value = data[index] as ChartPoint;
|
||||
|
||||
return `${label}: ${parseFloat(value.y as string).toPrecision(2)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -56,7 +56,7 @@ export enum ChartKind {
|
||||
PIE = "pie",
|
||||
BAR = "bar",
|
||||
LINE = "line",
|
||||
DOUGHNUT = "doughnut"
|
||||
DOUGHNUT = "doughnut",
|
||||
}
|
||||
|
||||
const defaultProps: Partial<ChartProps> = {
|
||||
@@ -66,7 +66,7 @@ const defaultProps: Partial<ChartProps> = {
|
||||
showLegend: true,
|
||||
legendPosition: "bottom",
|
||||
plugins: [],
|
||||
redraw: false
|
||||
redraw: false,
|
||||
};
|
||||
|
||||
export class Chart extends React.Component<ChartProps> {
|
||||
@@ -108,9 +108,9 @@ export class Chart extends React.Component<ChartProps> {
|
||||
...data,
|
||||
datasets: data.datasets && data.datasets.map(set => {
|
||||
return {
|
||||
...set
|
||||
...set,
|
||||
};
|
||||
})
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export class Chart extends React.Component<ChartProps> {
|
||||
|
||||
datasets[index] = {
|
||||
...datasets[index],
|
||||
...props
|
||||
...props,
|
||||
};
|
||||
} else {
|
||||
datasets[datasetIndex] = next;
|
||||
@@ -190,7 +190,7 @@ export class Chart extends React.Component<ChartProps> {
|
||||
return labelElem(label, color);
|
||||
})}
|
||||
{!labels && datasets.map(({ borderColor, label, tooltip }) =>
|
||||
labelElem(label, borderColor as any, tooltip)
|
||||
labelElem(label, borderColor as any, tooltip),
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@@ -206,7 +206,7 @@ export class Chart extends React.Component<ChartProps> {
|
||||
options: {
|
||||
...options,
|
||||
legend: {
|
||||
display: false
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
data: this.currentChartData,
|
||||
|
||||
@@ -65,12 +65,12 @@ export class PieChart extends React.Component<Props> {
|
||||
elements: {
|
||||
arc: {
|
||||
borderWidth: 1,
|
||||
borderColor: contentColor
|
||||
borderColor: contentColor,
|
||||
},
|
||||
},
|
||||
cutoutPercentage: cutouts[data.datasets.length - 1] || 50,
|
||||
responsive: true,
|
||||
...options
|
||||
...options,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -58,7 +58,7 @@ export const ZebraStripes = {
|
||||
updateOptions(chart: ChartJS) {
|
||||
this.options = {
|
||||
...defaultOptions,
|
||||
...this.getOptions(chart)
|
||||
...this.getOptions(chart),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -122,5 +122,5 @@ export const ZebraStripes = {
|
||||
|
||||
cover.style.backgroundPositionX = `${-step * minutes}px`;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user