biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
13.94k stars 422 forks source link

🐛 useNamingConvention same fix as the current one #664

Closed 11Firefox11 closed 10 months ago

11Firefox11 commented 10 months ago

Environment information

CLI:
  Version:                      1.3.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/9.2.0"

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

Workspace:
  Open Documents:               0

What happened?

The fix for the useNamingConvention rule is same as the current code. For example it suggests to rename my variable fooYPosition to fooYPosition.

Run this playground and get this output:

✖ This top-level const name should be in camelCase or PascalCase or CONSTANT_CASE.

  > 1 │ const fooYPosition = 0;
      │       ^^^^^^^^^^^^
    2 │ 

  ℹ The name could be renamed to `fooYPosition`.

Expected result

Don't suggest a fix if there is no fix for it, meaning the fix is same as the current name.

Code of Conduct

Conaclos commented 10 months ago

Thanks for reporting this bug! If you want to enable consecutive uppercase characters in camel and pascal cases, you can turn off the strictCase option.