Skip to content

Enhancement: [no-mixed-enums] Use scope analysis instead of type checking for namespaces #8352

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/no-mixed-enums

Description

I'd added this TODO a year ago but never filed an issue for it:

// TODO: We don't need to dip into the TypeScript type checker here!
// Merged namespaces must all exist in the same file.
// We could instead compare this file's nodes to find the merges.
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id);
const declarations = typeChecker
.getSymbolAtLocation(tsNode)!
.getDeclarations()!;

Additional Info

Marking as refactor rather than enhancement or performance as it likely won't noticeably improve rule performance in 99.9% of cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginrefactorPRs that refactor code only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions