question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: expose `ignoredCallee` to `no-array-callback-reference` rule

See original GitHub issue

This rule is awesome, but with some older code in AngularJS, we find ourselves having to inline disable unicorn/no-array-callback-reference regularly where our code uses things like Angular.forEach. There are of course much more modern alternatives to this nowadays, but configuration is always helpful.

Rather than maintain this list privately, I think it would make sense to expose in the rule configuration so users can configure it for their own needs. Something like:

"unicorn/no-array-callback-reference": ["error", {
	"ignoredCallee": [
		"Promise",
		"React.children",
		"Children",
		"lodash",
		"underscore",
		"_",
		"Async",
		"async",
		"Angular"
	]
}]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Dec 31, 2020

That makes sense, though if we had our own internal library that exposed a forEach function, having a way to tweak that list for our specific use-case would be beneficial.

Sure, and if someone presents an use-case like that, we will expose an option, but I would prefer to wait until such time.

1reaction
sindresorhuscommented, Dec 31, 2020

The problem with exposing the list is that everyone will be too lazy to contribute additions and instead just ignore it in their own config. As long as it’s something generally useful, I think we should encourage people to submit to our ignore list instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@thibaudcolas/eslint-plugin-cookbook - Package Manager
The format is based on Keep a Changelog and this project adheres to Semantic Versioning, enforced with semantic-release. 6.0.0 (2020-06-03). Features. config ...
Read more >
C++ Core Guidelines - GitHub Pages
The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++.
Read more >
eslint/CHANGELOG.md at main - GitHub
68f64a9 feat: update eslint-scope to ignore "use strict" directives in ES3 ... 981fb48 fix: do not report global references in id-match rule (#15420)...
Read more >
@cling/eslint-config - npm
@cling/eslint-config. Rules. eslint. Possible Errors ... ( unicorn/no-array-callback-reference ); Disallow using the this argument in array ...
Read more >
Code Issues - Embold Help Center
AnalysisOrder, Print callbacks that are called during analysis in order ... In most circumstances, this ignores an exception which should either be acted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found