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

💅 useNamingConvention forbids the readonly modifier for indexParameter selector kind #4277

Closed
1 task done
sepruko opened this issue Oct 14, 2024 · 3 comments · Fixed by #4286
Closed
1 task done
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@sepruko
Copy link
Contributor

sepruko commented Oct 14, 2024

Environment information

CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v20.18.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Error:                        The `readonly` modifier cannot be used with the `index parameter` kind.
  Status:                       Loaded with errors
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  true
  GraphQL enabled:              false
  Recommended:                  false
  All:                          false
  Enabled rules:
  style/useNamingConvention

Workspace:
  Open Documents:               0

Rule name

style/useNamingConvention

Playground link

https://github.com/sepruko/biome-repro/tree/style/use-naming-convention-0

Expected result

When configured to ensure index parameters with the readonly modifier are of specific formats and/or patterns, it should successfully parse its configuration file and emit the correct diagnostics.

The TypeScript Handbook clearly includes an example showing an index parameter marked as readonly, and the official tsc compiler has no issue handling this code.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico
Copy link
Member

The configuration you provided has errors, the rage output confirms it.

Can you please make sure to fix that?

@ematipico ematipico added S-Needs repro Status: needs a reproduction and removed S-Needs triage Status: this issue needs to be triaged labels Oct 14, 2024
Copy link
Contributor

Hello @sepruko, please provide a minimal reproduction. You can use one of the following options:

  • Provide a link to our playground, if it's applicable.
  • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

@sepruko
Copy link
Contributor Author

sepruko commented Oct 14, 2024

The configuration you provided has errors, the rage output confirms it.

Can you please make sure to fix that?

The error is the problem, it is complaining that the readonly modifier is incompatible with the indexParameter kind when TypeScript itself says it is, in fact, not.

@ematipico ematipico added S-Needs triage Status: this issue needs to be triaged and removed S-Needs repro Status: needs a reproduction labels Oct 14, 2024
@Conaclos Conaclos added S-Bug-confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter L-JavaScript Language: JavaScript and super languages and removed S-Needs triage Status: this issue needs to be triaged labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter 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.

3 participants