New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An equivalent rule for unused imported @typedef
similar to no-unused-vars
#1165
Comments
Actually, it would seem like the problem would still persist if I were to import it instead with JavaScript since importing just JSDoc types wouldn't be supported. For example, if I were to have: // typedefs.js
/**
* @exports foo
* @typedef {object} foo
* @property {string} bar
*/
exports.unused = {}; And |
Motivation
Hey everyone, been digging around the issues with regards to rules that relates to
@typedef
, but I don't see one so far or I might have missed it. If there is an issue already resolved or closed, would be happy to be linked to that. For now, I would like to open a feature request for the following.At the moment, there's no way to check if an imported
@typedef
is no longer in use from existing rules in the plugin that's similar to an unused declared variable or unused library/package. ESLint does not produces no warnings or errors for@typedefs
. Thus it up to the developer to manually spot and remove code that's no longer in use.Current behavior
Currently, there are no warnings/errors for unused
@typedefs
from ESLint.Desired behavior
With this new feature, it'll produce a warning or error for unused
@typedefs
from ESLint.Alternatives considered
Creating a custom rule (no-unused-typedefs) specifically for
@typedef
The text was updated successfully, but these errors were encountered: