Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-implied-eval] False Positive Fired with Binded Class Func #3582

Closed
3 tasks done
gfyoung opened this issue Jun 27, 2021 · 0 comments · Fixed by #3598
Closed
3 tasks done

[no-implied-eval] False Positive Fired with Binded Class Func #3582

gfyoung opened this issue Jun 27, 2021 · 0 comments · Fixed by #3598
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@gfyoung
Copy link
Contributor

gfyoung commented Jun 27, 2021

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/no-implied-eval": "error"
  }
}
class Foo {
  name: string;

  constructor() {
    this.name = 'foo';
  }

  func1(): string {
    return this.name;
  }

  func2(): void {
    setTimeout(this.func1.bind(this), 1);
  }
}

export default new Foo();

Expected Result

No errors

Actual Result

13:16  error  Implied eval. Consider passing a function  @typescript-eslint/no-implied-eval

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.28.0
@typescript-eslint/parser 4.28.0
TypeScript 4.3.4
ESLint 7.29.0
node 16.3.0
@gfyoung gfyoung added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jun 27, 2021
@gfyoung gfyoung changed the title [no-implied-eval] False Positive Fired with Class Func [no-implied-eval] False Positive Fired with binded Class Func Jun 27, 2021
@gfyoung gfyoung changed the title [no-implied-eval] False Positive Fired with binded Class Func [no-implied-eval] False Positive Fired with Binded Class Func Jun 27, 2021
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for team members to take a look labels Jul 6, 2021
nanaya added a commit to nanaya/osu-web that referenced this issue Jul 12, 2021
The linter is a bit buggy [1] at the moment.

Made the functions private while at it.

[1] typescript-eslint/typescript-eslint#3582
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants