Closes #32. We want to catch unused vars even when they are function arguments.
Implementation
In both the JS and TS config change no-unused-vars config to:
error on all unused function arguments, not just arguments after the used ones
allow suppressing the error by prefixing the variable name with an underscore
I investigated providing a custom error but this rule doesn't support that. The default error is fairly informative: "'bar' is defined but never used. Allowed unused args must match /^_/u no-unused-vars". Furthermore the VSCode autofixer suggestion list includes "Prefix with underscore" so I think the workaround is plenty discoverable.
I also made the comment style more consistent by removing a few **s.
Testing
Locally added unused parameters to both JS and TS test files and verified that they were flagged by the linter unless prefixed with an underscore.
Justification
Closes #32. We want to catch unused vars even when they are function arguments.
Implementation
In both the JS and TS config change
no-unused-vars
config to:I investigated providing a custom error but this rule doesn't support that. The default error is fairly informative: "'bar' is defined but never used. Allowed unused args must match /^_/u no-unused-vars". Furthermore the VSCode autofixer suggestion list includes "Prefix with underscore" so I think the workaround is plenty discoverable.
I also made the comment style more consistent by removing a few
**
s.Testing
Locally added unused parameters to both JS and TS test files and verified that they were flagged by the linter unless prefixed with an underscore.