- May 6, 2011--- In firstname.lastname@example.org, "Douglas Crockford" <douglas@...> wrote:
> --- In email@example.com, "Zhami" <stuart@> wrote:
> > I often include names for arguments that aren't used as a form of reminder/documentation (say, for callbacks that are being invoked by libraries that are not mine).
> > Perhaps JSLint could allow for a pragma or directive within a function body that indicates that the named argument is intentionally not be used.
> If you want to suppress that report, set option.unparam to true.
I don't want to suppress that report for the entire file, as I believe this is yet another valuable warning you have added to JSLint.
However, sometime the function is a callback and the unused param is left-wards of a param that I do use, and so must name the unused param to properly position.
I did try turning off the report by an inline comment prior to the declaration of the function:
/*jslint unparam: false */
But that didn't work.
I do think it would be useful to either be able to turn iteh reporting on and off around certain function, or to have a pragma *within* a function:
/*jslint unparam: varname */
which would let JSLint know that a named parameter is intentionally not used.
Thanks for considering this.
- << Previous post in topic Next post in topic >>