-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Repro
{
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
]
}
const obj = {
func(this: void): void {
console.log('a');
}
};
function acceptsFunc(a: () => void) {
a();
}
acceptsFunc(obj.func);
Expected Result
Since the method explicitely doesn't use this
in the function, the rule should not warn. (See also the relevant section in the Handbook)
Actual Result
Additional Info
error Avoid referencing unbound methods which may cause unintentional scoping of `this` @typescript-eslint/unbound-method
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.0.0 |
@typescript-eslint/parser |
2.0.0 |
TypeScript |
3.5.3 |
ESLint |
6.1.0 |
node |
11.15.0 |
npm |
6.7.0 |
ab-pm and ryota-ka
Metadata
Metadata
Assignees
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin