A
A
Alianos2021-05-12 22:42:45
JavaScript
Alianos, 2021-05-12 22:42:45

How to make eslint not throw an error on an unused function?

Hello, I have a function called globally, i.e. by the browser, how can I get around the eslint error: function declared but never used?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Confy, 2021-05-12
@Alianos

In order to ignore such a warning once, you need to add a special comment above the line with the function declaration:

// eslint-disable-next-line no-unused-vars
function unused() {}

A description of more advanced rule adjustments can be found here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question