I need to create an object, and I don't need the reference to it once it's created. I have this code:
const myPieChart = new Chart(context, {
type: "pie",
data: dataSource
});
But I get the warning 'myPieChart' is declared but its value is never read.ts(6133)
and SolarLint says Remove this useless assignment to variable "myPieChart".sonarlint(typescript:S1854)
If I instead use this code:
new Chart(context, {
type: "pie",
data: dataSource
});
TSLint complains: unused expression, expected an assignment or function call (no-unused-expression)tslint(1)
Surely there must be a proper way to write this code without just disabling one of the warnings?
or