Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues
and found none that matched my issue(see description) - I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
constcollator=newIntl.Collator("en")constsorted=["foo","bar"].sort(collator.compare)
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/unbound-method":"error"},};
tsconfig
No response
Expected Result
The rule should not fire an error for this code, asIntl.Collator.prototype.compare
isbound tocollator according to the ECMAScript spec.
Actual Result
The rule fires for the use ofcollator.compare
:
Avoid referencing unbound methods which may cause unintentional scoping of `this`.If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead. 4:36 - 4:52
Additional Info
This is a duplicate of#4383, which was marked 'unable to repro'. However, the playground example linked in the team response actually reproduces the issue.