Requesting underscore demarcation for no-unused-vars
See original GitHub issueThe rule no-unused-vars
is very useful. However there are times at which its current structure is at odds with other peoples’ APIs.
Consider the case of a page error handler to express.js
, whose signature is roughly
app.use(function(err, req, res, next) { ... });
If you want to write a 404 handler that looks at what the actual err
or was, and sets things on the res
ponse, but doesn’t care what the req
uest is (say, maybe you’re making an imgur clone,) then you’re out of luck: there is no way to write that which won’t ring eslint
’s bell.
Could eslint
be extended to do what erlang
does? Prefixing a name with an underscore in erlang
suppresses non-use detection. Then we could just name them _req
and _next
and the problem goes away.
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to disable warn about some unused params, but keep ...
Only way that I found is to use ignore pattern argsIgnorePattern in rule options. If your variable is unused, just add underscore _ctx...
Read more >no-unused-vars - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >Core Technologies - Spring
As a corner case, it is possible to receive destruction callbacks from a custom scope — for example, for a request-scoped inner bean...
Read more >Debezium connector for PostgreSQL
This means that the connector does not have the complete history of all changes that ... You initiate an ad hoc snapshot by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since 2014 the rule
no-unused-vars
have news options.You can use http://eslint.org/docs/rules/no-unused-vars#argsignorepattern
Example in
package.json
cheers, thanks 😄