Skip to content

Bug: [unbound-method] Does not specify which destructured method is unbound #6276

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

Closed
4 tasks done
JoshuaKGoldberg opened this issue Dec 25, 2022 · 0 comments · Fixed by #6281
Closed
4 tasks done

Bug: [unbound-method] Does not specify which destructured method is unbound #6276

JoshuaKGoldberg opened this issue Dec 25, 2022 · 0 comments · Fixed by #6281
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JoshuaKGoldberg
Copy link
Member

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.

Playground Link

https://typescript-eslint.io/play/#ts=4.9.3&sourceType=module&showAST=ts&code=MYewdgzgLgBAbgQwDYFcCmEYF4YG8BQMRMCAFAJR4wC+ANIcQEYBcMF2AfFXQ9fvqEixcJWjEY1s8ZOggBuIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6WJgIwHsOATWgFtE+ABbc+6KImjRu0SODABfEMqA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

const values = {
    a() { },
    b: () => { },
  }

const { a, b } = values;

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/unbound-method": "error"
  }
}

tsconfig

{
  "compilerOptions": {
    "strictNullChecks": true
  }
}

Expected Result

Specifically a should be indicated as the offending unbound method.

Actual Result

All of { a, b } is squigglied.

Additional Info

Found when looking at tRPC's source. Thanks for the poke @KATT 😄

https://github.com/trpc/trpc/blob/269c9a2eedeae075be7f9863f870d907cb36d01d/examples/standalone-server/src/server.ts#L75-L78

@JoshuaKGoldberg JoshuaKGoldberg added bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin accepting prs Go ahead, send a pull request that resolves this issue labels Dec 25, 2022
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Dec 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant