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

🐛 useEnumInitializers should not emit diagnostics in ambient namespaces #19

Closed
1 task done
Conaclos opened this issue Aug 20, 2023 · 0 comments · Fixed by #20
Closed
1 task done

🐛 useEnumInitializers should not emit diagnostics in ambient namespaces #19

Conaclos opened this issue Aug 20, 2023 · 0 comments · Fixed by #20
Assignees
Labels
A-Linter Area: linter

Comments

@Conaclos
Copy link
Member

Environment information

main branch.

What happened?

The following code should not emit diagnostics:

declare namespace X {
  enum Enum {
    A,
    B,
  }
}

Here the namespace creates an ambient context, making Enum an ambient enum.
The rule thinks that Enum is a concrete enum.

Note that the issue is recursive:

export declare namespace X {
    export namespace Y {
        export enum Enum {
            A,
            B,
        }
    }
}

See this example in the playground.

Expected result

Enum should be recognized as an ambient enum and thus the rule should ignore the enum.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant