Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
Minimal example
Repro Code
const collator = new Intl.Collator("en")
const sorted = ["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, as Intl.Collator.prototype.compare is bound to collator according to the ECMAScript spec.
Actual Result
The rule fires for the use of collator.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.
Before You File a Bug Report Please Confirm You Have Done The Following...
and found none that matched my issue(see description)Playground Link
Minimal example
Repro Code
ESLint Config
tsconfig
No response
Expected Result
The rule should not fire an error for this code, as
Intl.Collator.prototype.compareis bound to collator according to the ECMAScript spec.Actual Result
The rule fires for the use of
collator.compare: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.