unicorn/no-fn-reference-in-iterator - wrong context
See original GitHub issueThe lint is claiming a MongoDB query (.find
)
// Example
// error Do not pass function `collection` directly to `.find(…)` unicorn/no-fn-reference-in-iterator
const results = await collection
.find({
$and: [cursorQuery, params.query]
}, {
projection: params.projection
})
.sort($sort)
.limit(params.limit + 1)
.toArray()
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
What's wrong with passing C++ iterator by reference?
In this context, I think that passing an iterator by reference is perfectly sensible, as long as it's well-documented.
Read more >eslint-config-ash-nazg - npm
The ash-nazg/sauron config expands upon the regular ash-nazg rules to indicate what are generally best practices but are less likely to be due...
Read more >Converse.js API Documentation Source: headless/dist ...
@private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array *...
Read more >How to capture a variable in C# and not to shoot yourself in ...
(A reference to the Action object in the current iteration). ... that is aimed at detecting incorrect capture of the variables and anonymous ......
Read more >Suppression of false positive warnings - PVS-Studio
You can notify the analyzer that the warning V678 issued on this code is a false positive. It can be done either manually...
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
No problem. As I comment above, if you use object in
.find({})
, it will ignored in https://github.com/sindresorhus/eslint-plugin-unicorn/pull/756. But.find(foo)
will still be a problem, you’ll have to use//eslint-disable
.With D3 delaunay error too.
I guess nothing can do about it.