Skip to content

[naming-convention] Allow multiple underscore #1712

@jhnns

Description

@jhnns

Repro

Hey ho 👋, this is a feature request. What do you think of allowing multiple leading or trailing underscores? There are some libraries that use double underscore (__) to avoid name clashes. Probably the most popular one is GraphQL where you can specify a __typename (see here).

Personally, I want to use camelCase or PascalCase and I'm ok with people pre- or postfixing names with underscores. We could introduce a 4th value for the leadingUnderscore and trailingUnderscore option that is called allowMultiple, like this:

{
  "rules": {
    "@typescript-eslint/naming-convention": ["warn", {
        "format": ["camelCase", "PascalCase", "UPPER_CASE"],
        "leadingUnderscore": "allowMultiple",
        "selector": "default",
        "trailingUnderscore": "allowMultiple"
    }]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    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