Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 useLiteralKeys doesn't ignore valid uses of square bracket notation #4370

Closed
1 task done
jpike88 opened this issue Apr 13, 2023 · 3 comments · Fixed by #4378
Closed
1 task done

🐛 useLiteralKeys doesn't ignore valid uses of square bracket notation #4370

jpike88 opened this issue Apr 13, 2023 · 3 comments · Fixed by #4378
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug

Comments

@jpike88
Copy link

jpike88 commented Apr 13, 2023

Environment information

CLI:
  Version:                      12.0.0-nightly.0133f40
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v16.14.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/9.6.3"

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

Workspace:
  Open Documents:               0

What happened?

This may be as intended, but then it differs in an important way from eslint dot-notation.

See below

wat

There is no way to specify a literal key while also allowing special characters, the rule must then be ignored to allow this line to happen. Sometimes square bracket notation is unavoidable.

Expected result

The rule should allow valid uses of square bracket notation

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@jpike88 jpike88 added the S-To triage Status: user report of a possible bug that needs to be triaged label Apr 13, 2023
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Apr 13, 2023
@ematipico
Copy link
Contributor

I assume you're using the nightly version of Rome?

Also, this rule is different from the ESLint rule dot-notation.

@jpike88
Copy link
Author

jpike88 commented Apr 13, 2023

That's right im on the recently released nightly.

In the meantime I'll just add a bunch of line ignore comments, was just unsure if this is desired outcome or not

@ematipico
Copy link
Contributor

Yeah, you did well to report the issue :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter 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