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.

[no-array-method-this-argument] False positive on non array object but has `map` method

See original GitHub issue
export interface ErrorMapperInterface {
  /**
   * Maps an error to a string.
   * @param {string} key the error key. i.e., required, etc
   * @param error the error object
   * @param control control Object (AbstractControl for Angular, NgModel for AngularJS)
   * @returns {string}
   */
  map(key: string, error?: any, control?: any): string;
}

declare const mapper: ErrorMapperInterface

mapperService.map(firstError, errors[firstError])

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JounQincommented, Jul 1, 2021

When @typescript-eslint/eslint-parser is used, we should know whether mapperService is a true array.

0reactions
fiskercommented, Jul 1, 2021

Sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My Array made of objects doesn't accepted map method ...
I have an array inside a state, but when I try to use the map method on it, I get the .map is...
Read more >
(react/jsx-key) false positive for a not array .map() method #2487
i use library fp-ts@1 and there is, for example, an Option. it has a method map, but it has nothing common with an...
Read more >
Array.prototype.map() - JavaScript - MDN Web Docs
The map() method creates a new array populated with the results of calling a provided function on every element in the calling array....
Read more >
19. Maps and Sets - Exploring JS
In contrast to Arrays, Sets don't have the methods map() and filter() . A work-around is to convert them to Arrays and back....
Read more >
JavaScript Map, Reduce, and Filter - JS Array Functions ...
If the condition returns false, the element does not get pushed to the output array. Syntax. var new_array = arr.filter(function callback( ...
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