Content-Length: 271081 | pFad | https://github.com/typescript-eslint/typescript-eslint/issues/2694

49 Rule proposal: disallow mixed string/numeric enums · Issue #2694 · typescript-eslint/typescript-eslint · GitHub
Skip to content

Rule proposal: disallow mixed string/numeric enums #2694

@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









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/typescript-eslint/typescript-eslint/issues/2694

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy