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(false-positive): quick-lint does not allow a type and variable to have the same name #981

Closed
vegerot opened this issue Apr 12, 2023 · 3 comments
Milestone

Comments

@vegerot
Copy link
Contributor

vegerot commented Apr 12, 2023

steps to reproduce:

let a = 1
type a = undefined

expected:
lints fine

actual:

you couldn't get enough of a, so you had to make two, huh?

While this syntax is confusing, it's frequently used to use const object literals as enums. Like

export const Thing = {
  "A": 1,
  "B": 2
} as const;

type Thing = typeof Thing

quick-lint-js version 2.12.0

@strager strager mentioned this issue Apr 12, 2023
57 tasks
@strager strager added this to the 3.0 milestone Apr 12, 2023
@leszek888
Copy link
Contributor

I could take this one.

@strager
Copy link
Collaborator

strager commented Apr 27, 2023

@leszek888 Sorry, but I am working on this myself.

@strager
Copy link
Collaborator

strager commented Aug 2, 2023

This has been fixed. I don't know when exactly, but it's working on master and probably quick-lint-js 2.15.0.

@strager strager closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants