Skip to content

[member-naming] Avoid for 'constructor' of class #359

Closed
@tetsuharuohzeki

Description

@tetsuharuohzeki

Repro

{
  "rules": {
        "@typescript-eslint/member-naming": ["warn", {
            "private": "^_",
            "protected": "^_",
        }],
  }
}
class A {
   private constructor() {}
}

class B {
   protected constructor() {}
}

Expected Result

@typescript-eslint/member-naming should avoid the warn/error if the method is constructor.

Actual Result

warning  private property constructor should match /^_/  @typescript-eslint/member-naming
warning   property constructor should match /^_/  @typescript-eslint/member-naming

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.4.2
@typescript-eslint/parser 1.4.2
TypeScript 3.3.3333
ESLint 5.15.2
node 11.6.0
npm X.Y.Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: 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