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

[camelcase] Allow disabling camelcase rule for class members #590

Closed
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin rulehas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@jimjenkins5

Description

@jimjenkins5

Repro

{"rules": {"@typescript-eslint/camelcase": ["error", {"properties":"never" } ]  }}
exportclassMyClassWithAStatic{publicstaticthis_should_pass():boolean{returntrue;}}

Expected Result

The static method should pass linting.

Actual Result

An error is reported:

2:18  error  Identifier'this_should_pass' is notin camelcase  @typescript-eslint/camelcase

Additional Info
When disabling the camelCase rule for properties, I would assume class members would also not be checked. However, ideally we would have even more control over this rule and be able to disable it for certain types of members (e.g. by accessibility, and especially for our use, static vs. instance)

The reason this is causing us an issue is that our coding standard is to use camelCase for all variables, properties and methods, but use snake_case for static methods. This is a common coding standard and it would be good to support it.

Even if our use case isn't specifically supported, being able to disable the rule for class methods and properties would be consistent with the currentproperties option.

Versions

packageversion
@typescript-eslint/eslint-plugin1.2.0
TypeScript3.3.1
ESLint5.11.1
node8.10.0
npm6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement: plugin rule optionNew rule option for an existing eslint-plugin rulehas prthere is a PR raised to close thispackage: 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


      [8]ページ先頭

      ©2009-2025 Movatter.jp