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

Bug: no-undef reports on class index signature #9053

Open
4 tasks done
hans000 opened this issue May 6, 2024 · 1 comment · May be fixed by #9054
Open
4 tasks done

Bug: no-undef reports on class index signature #9053

hans000 opened this issue May 6, 2024 · 1 comment · May be fixed by #9054
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@hans000
Copy link

hans000 commented May 6, 2024

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=5.0.4&showAST=es&fileType=.tsx&code=JYOwLgpgTgZghgYwgAgJIDED2nkG8BQyyIcAthAFzIDOYUoA5ocgNoAeVt9IDAulXBABPfAF98%2BBABs41asiw4CRdpzqN%2ByQSKIlya7k3FA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaWXAE0QDN0pFpp9pJwwBfEFoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYwAviNUA&tokens=false

Repro Code

interface IFoo {
  name: string
  [x: string]: any
}

class Foo {
  [x: string]: any
  name: string
}

ESLint Config

{
  "rules": {
    "no-undef": "error"
  }
}

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

No error

Actual Result

'x' is not defined. on the class

Additional Info

No response

@hans000 hans000 added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels May 6, 2024
@hans000
Copy link
Author

hans000 commented May 6, 2024

eslint/eslint#18421

@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels May 6, 2024
@yeonjuan yeonjuan linked a pull request May 6, 2024 that will close this issue
3 tasks
@Josh-Cena Josh-Cena changed the title Bug: no-undef a error analysis Bug: no-undef reports on class index signature Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working 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