Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tetsuharuohzeki opened this issue Mar 16, 2019 · 1 comment · Fixed by #376
Closed

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

tetsuharuohzeki opened this issue Mar 16, 2019 · 1 comment · Fixed by #376
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@tetsuharuohzeki
Copy link
Contributor

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
@tetsuharuohzeki tetsuharuohzeki added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Mar 16, 2019
@j-f1 j-f1 added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Mar 19, 2019
@gavinbarron
Copy link
Contributor

I'll take a look at this one

@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants