You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A variable reference (specifically an imported value) is correctly recognized inside a @typedef and will ensure that the variable in question is treated as "used."
Actual behavior
In such a case, assuming no other references, the variable definition in question is treated as unused, as in the error:
1:8 error 'fs' is defined but never used no-unused-vars
But, if the variable definition (e.g. the import) is removed / commented out, then that also turns into an error because it isn't defined, as in the error:
4:1 warning The type 'fs' is undefined jsdoc/no-undefined-types
Somehow, the @typedef both does and doesn't reference the variable. Wacky!
Expected behavior
A variable reference (specifically an
import
ed value) is correctly recognized inside a@typedef
and will ensure that the variable in question is treated as "used."Actual behavior
In such a case, assuming no other references, the variable definition in question is treated as unused, as in the error:
But, if the variable definition (e.g. the
import
) is removed / commented out, then that also turns into an error because it isn't defined, as in the error:Somehow, the
@typedef
both does and doesn't reference the variable. Wacky!ESLint Config
ESLint sample
You can see the two errors above by either leaving the
import
line as-is or commenting it out.In case it's handy, here's a tarball of the example. You can unpack it and then run
./demo
:bug-report.tar.gz
Environment
eslint-plugin-jsdoc
version: 50.6.1The text was updated successfully, but these errors were encountered: