Bug: [unbound-method] False reports on class property with `this: void`
Author: JoshuaKGoldbergCreated Sep 15, 2026Updated Sep 15, 2026
Labelsbugpackage: eslint-pluginaccepting prs
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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
- If I used AI assistance to prepare this issue, I have reviewed and followed the AI Contribution Policy.
Playground Link
Repro Code
class Example {
property = function (this: void) {};
}
new Example().property;ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/unbound-method": "error"
}
}tsconfig
{
"compilerOptions": {
"allowJs": true,
"strictNullChecks": true
}
}Expected Result
No rule report, since the property has this: void.
Actual Result
A method that is not declared with this: void may cause unintentional scoping of this when separated from its object.
Consider using an arrow function or explicitly .bind()ing the method to avoid calling the method with an unintended this value. 5:1 - 5:16
Additional Info
Discovered as part of #12803 (what a tangent!). A fix is in draft in #12886.
Source: typescript-eslint/typescript-eslint