Skip to content

Rule proposal: disallow mixed string/numeric enums #2694

Closed
@osdiab

Description

@osdiab

Related to #2693 , in my project we only use either purely numeric or purely string enums; i want to discourage my teammates to make enums that have both, since it makes it trickier to get a definite set of enum values from the enum object.

// bad
enum Foo {
  A = "A",
  B,
  C = 5
}

// OK
enum Bar {
  A = "A",
  B = "B"
}

enum Baz {
  A,
  B,
  C = 5
}

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy