10000 Enhancement: Forbid duplicated accessibility modifiers · Issue #7495 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Enhancement: Forbid duplicated accessibility modifiers #7495

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

Closed
4 tasks done
fisker opened this issue Aug 17, 2023 · 1 comment · Fixed by #8257
Closed
4 tasks done

Enhancement: Forbid duplicated accessibility modifiers #7495

fisker opened this issue Aug 17, 2023 · 1 comment · Fixed by #8257
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree

Comments

@fisker
Copy link
Contributor
fisker commented Aug 17, 2023

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

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

Forbid duplicated accessibility modifiers.

Fail

class Foo {
  public public a;
  private public b;
  protected private c;
  public protected d;
  public protected private e;
}

Pass

Should throw errors.

Additional Info

No response

@fisker fisker added enhancement New feature or request triage Waiting for team members to take a look labels Aug 17, 2023
@fisker fisker changed the title Enhancement: <a short description of my proposal> Enhancement: Forbid duplicated accessibility modifiers Aug 17, 2023
@bradzacher bradzacher added package: typescript-estree Issues related to @typescript-eslint/typescript-estree AST PRs and Issues about the AST structure accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Aug 17, 2023
@bradzacher
Copy link
Member

I'm quite surprised that this is a semantic error and not a syntactic one.
I guess that it's more permissive with refactors and such but it seems smelly to me.

I thought that maybe they did this to allow different orderings of modifiers - but that's actually disallowed (eg readonly public, static public and readonly static are all semantic errors too).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
2DAB @fisker @bradzacher
0