Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[naming-convention] enumMembers should be default PascalCase #7879

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginpreset config changeProposal for an addition, removal, or general change to a preset config
@Mister-Hope

Description

@Mister-Hope

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

Description

Code like this fails with the default option:

constenumSearchItemType{Page=0,ID=1,}constenumSearchIndexType{Title=1,Heading=2,Text=3,Image=4,Card=5,Doc=6,}

However, I think using PascalCase for enum member should be the default option, as this is the default syntax in TypeScript official docs, blogs and examples.

E.g.:


Other things to report and could be a feature request

The problem is affecting me because we are not providing a keyword to enable the default naming convention and "make some tweaks over it". I.E.: In this case, I can not simply add the green line below, instead I have to redeclare the whole "option". That is not convinient for me accross projects.

Impacted Configurations

// the default config is similar to ESLint's camelcase rule but more strictconst defaultOptions: Options = [  {    selector: 'default',    format: ['camelCase'],    leadingUnderscore: 'allow',    trailingUnderscore: 'allow',  },  {    selector: 'import',    format: ['camelCase', 'PascalCase'],  },  {    selector: 'variable',    format: ['camelCase', 'UPPER_CASE'],    leadingUnderscore: 'allow',    trailingUnderscore: 'allow',  },  {    selector: 'typeLike',    format: ['PascalCase'],  },+  {+    selector: 'enumMember',+    format: ['PascalCase'],+  },];

Additional Info

No response

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-pluginpreset config changeProposal for an addition, removal, or general change to a preset config

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp