[unbound-method] Should prevent conforming to a bound-style interface method with an unbound method #3503
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
eslint config: https://github.com/foxglove/eslint-plugin/blob/main/configs/typescript.js
tsconfig: https://github.com/foxglove/studio/blob/main/packages/tsconfig/tsconfig.base.json
Expected Result
class Example implements Foo
is problematic. There should be an error onbound() { return this.x }
when is used to satisfy the interface requirementbound: () => number;
.Actual Result
The lint rule does not reject this incorrect method implementation, which leads to a runtime error.
Versions
@typescript-eslint/eslint-plugin
4.26.0
@typescript-eslint/parser
4.26.0
TypeScript
4.3.2
ESLint
7.27.0
node
15.9.0
The text was updated successfully, but these errors were encountered: