biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

Home Page:https://biomejs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Trying to override `useConst` doesn't work. .svelte files

KyleFontenot opened this issue Β· comments

Environment information

CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           macos

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

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

Workspace:
  Open Documents:               0

What happened?

As it clearly mentions in the docs: https://biomejs.dev/internals/language-support/#html-super-languages-support There are some incompatibilities with .svelte files.
And thats ok, but the linter is still throwing : This let declares a variable that is only assigned once. even after overriding the rule using :

"overrides": [
    {
      "include": ["*.svelte"],
      "linter": {
      "rules": {
	"style": {
            "useConst": "off"
	}
      }
    }
  }
]

The lint error still persists when using export let variablename ... as intended by Svelte

Expected result

Using the officially documented biome.json option for overriding the useConst rule should suppress the error until more Svelte support is adapted.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Can you share a small reproduction? GitHub repo or codesandbox

I think I just needed to restart the biome lsp. I'm using a different pc setup today and it's working fine.
Thank you