I have an issue with VS Code suggestion turning a function in JS into a class. It gives the following suggestion message:
This constructor function may be converted to a class declaration. ts(80002)
I do understand why the suggestion and highlighting are done as described in this SO question.
While it is just a suggestion it does not alter the code but the wrongly highlighted function annoys me. I have found a SO question on how to disable all suggestions.
I still want to know if there is an option to disable only this specific suggestion and the wrong highlighting instead of all.
How can only this specific highlighting fixed to show the color of functions instead of classes?
(Code for those that require all questions to have code in the question itself):
function init() {
BUTTON_LABELS.forEach((label, index) => {
const BUTTON = document.createElement('button');
BUTTON.addEventListener('click', move);
BUTTON.ariaLabel = label;
BUTTON.dataset.id = index;
BOARD.appendChild(BUTTON);
})
}
function move() {
if (!this.textContent.length) {
this.textContent = PLAYERS[turn];
saveMove(this.dataset.id);
}
}