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

🐛 Parsing problem when using trailing commas after get accessors argument #4317

Closed
1 task done
thecp opened this issue Oct 17, 2024 · 0 comments · Fixed by #4324
Closed
1 task done

🐛 Parsing problem when using trailing commas after get accessors argument #4317

thecp opened this issue Oct 17, 2024 · 0 comments · Fixed by #4324
Labels
A-Parser Area: parser L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@thecp
Copy link

thecp commented Oct 17, 2024

Environment information

CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.15.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.7.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

There seems to be a parsing problem when having a get-Accessor with a comma after the input value like this:

export class DummyComponent {
set input(
value: string,
) {
this._value = value;
}

_value = '';
}

One could remove the comma but in certain scenarios prettier would add the comma back as this should be also a valid state when setting Prettiers "trailing comma" rule to "all"

https://biomejs.dev/playground/?code=ZQB4AHAAbwByAHQAIABjAGwAYQBzAHMAIABEAHUAbQBtAHkAQwBsAGEAcwBzACAAewAKACAAIABzAGUAdAAgAGkAbgBwAHUAdAAoAAoAIAAgACAAIAB2AGEAbAB1AGUAOgAgAHMAdAByAGkAbgBnACwACgAgACAAKQAgAHsACgAgACAAIAAgAHQAaABpAHMALgBfAHYAYQBsAHUAZQAgAD0AIAB2AGEAbAB1AGUAOwAKACAAIAB9AAoACgAgACAAXwB2AGEAbAB1AGUAIAA9ACAAJwAnADsACgB9AA%3D%3D

Expected result

parser should be able to handle trailing commas after input arguments for get accessors

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@thecp thecp added the S-Needs triage Status: this issue needs to be triaged label Oct 17, 2024
@ematipico ematipico added L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Oct 17, 2024
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Oct 17, 2024
@ematipico ematipico added A-Parser Area: parser S-Needs triage Status: this issue needs to be triaged labels Oct 17, 2024
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Parser Area: parser L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants