FR: Add javascript.exported
config, as a counterpart to javascript.globals
#1147
chrisgrieser
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Could you add an example? or link to an example? Why not explicitly export the variable? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
biome currently has an allowlist for
noUndeclaredVariables
in the form ofjavascript.globals
, where we can globally define exceptions fornoUndeclaredVariables
instead of disabling the rule at every occurrence of the variable.I'd like to propose introducing
javascript.exported
which should act as an allowlist fornoUnusedVariables
in the very same way. Other tools like for example the lua LSP allow for such an allowlist. eslint also supports such an allowlist, but in the form of the rule option forno-unused-vars
.The use case of such a setting / rule option would be to allow for variables that are implicitly exported, for example the
run
function in JXA. (Right now, the alternative is to literally add a disabling-comment at every single occurrence of suchrun
functions.)Beta Was this translation helpful? Give feedback.
All reactions