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
{{ message }}
Repository navigation
False positives + query ideas for variables with leading underscores. #655
I'm sure you're right, but could we have a reference for that convention? I'd also like to point out that in the examples you give you should be able to just omit the _* variables altogether:
The argsIgnorePattern option specifies exceptions not to check for usage: arguments whose names match a regexp pattern. For example, variables whose names begin with an underscore.
Prefix with _ unused block parameters and local variables. It's also acceptable to use just _ (although it's a bit less descriptive). This convention is recognized by the Ruby interpreter and tools like RuboCop and will suppress their unused variable warnings.
I'd also like to point out that in the examples you give you should be able to just omit the _* variables altogether
Activity
xiemaisi commentedon Dec 10, 2018
I'm sure you're right, but could we have a reference for that convention? I'd also like to point out that in the examples you give you should be able to just omit the
_*variables altogether:s0 commentedon Dec 10, 2018
Here are a few of places:
Typescript compiler's behaviour for compiler flags
--noUnusedParametersand--noUnusedLocals(If we decide it's not a widely-enough used convention for JS, we could potentially enable it for TS only)
ESLint documentation on
no-unused-vars. Uses prefix underscores as an example for theargsIgnorePatternoption:Ruby's community coding conventions:
Ah yes!
xiemaisi commentedon Dec 11, 2018
OK, thanks, that looks fairly widely accepted.
We could, but to be honest I doubt we'll lose any interesting results by enabling it for JS as well.