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

[unbound-method] this: void syntax should be highlighted in document and suggested in message #3201

Closed
3 tasks done
JounQin opened this issue Mar 19, 2021 · 0 comments · Fixed by #3203
Closed
3 tasks done
Labels
documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JounQin
Copy link
Contributor

JounQin commented Mar 19, 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

sveltejs/eslint-plugin-svelte3#103 (comment)

{
  "rules": {
    "@typescript-eslint/unbound-method": 2
  }
}
// on:animationend={myStore.action}

const myStore = {
  action(event: AnimationEvent | string) {
    // handle event here
  },
}

Expected Result

Better message and better document for suggesting this: void

Actual Result

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.10.0
@typescript-eslint/parser 4.10.0
TypeScript 4.2.3
ESLint 7.10.0
node 14.16.0
@JounQin JounQin added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Mar 19, 2021
@bradzacher bradzacher added documentation Documentation ("docs") that needs adding/updating and removed triage Waiting for maintainers to take a look labels Mar 19, 2021
bradzacher added a commit that referenced this issue Mar 21, 2021
* docs: highlight `this: void` and arrow function for unbound-method

close #3201

* Update packages/eslint-plugin/docs/rules/unbound-method.md

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* feat: check if the first param is `this`

add new message `unboundWithoutThisAnnotation`

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants