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

🐛 fix of useRegexLiteral does not work correctly #1990

Closed
1 task done
riya-amemiya opened this issue Mar 7, 2024 · 1 comment
Closed
1 task done

🐛 fix of useRegexLiteral does not work correctly #1990

riya-amemiya opened this issue Mar 7, 2024 · 1 comment

Comments

@riya-amemiya
Copy link

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.6.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.0.30"

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

Workspace:
  Open Documents:               0

What happened?

Biome suggests the following correction:

1   const foo = {
2  - ··bar:·new·RegExp("/about/foo").test("foo"),
2  + ··bar:·//about/foo/.test("foo"),
3   };

However, this will be recognized as a comment and result in an error.

https://codesandbox.io/p/devbox/vibrant-margulis-5mz7rn?file=%2Fsrc%2Findex.js%3A2%2C1&workspaceId=a1c3e0b6-6b56-444a-a254-d876331f7de6

Expected result

The correct modification should be as follows:

1  const foo = {
2  - ··bar:·new·RegExp("/about/foo").test("foo"),
2  + ··bar:·/\/about\/foo/.test("foo"),
3};

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@togami2864
Copy link
Contributor

togami2864 commented Mar 7, 2024

https://biomejs.dev/playground/?lintRules=all&code=IABjAG8AbgBzAHQAIABmAG8AbwAgAD0AIAB7AAoAIAAgACAAYgBhAHIAOgAgAG4AZQB3ACAAUgBlAGcARQB4AHAAKAAiAC8AYQBiAG8AdQB0AC8AZgBvAG8AIgApAC4AdABlAHMAdAAoACIAZgBvAG8AIgApACwACgAgAH0A

Thank you for reporting! I think this bug was already fixed in PR, and version 1.6.0, includes those changes will be released soon:)

@Conaclos Conaclos closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants