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
15.47k stars 480 forks source link

💅 Suppression comment fails with inner comments in functions #4519

Open maxmorozoff opened 6 days ago

maxmorozoff commented 6 days ago

Environment information

(edited)

CLI:
  Version:                      1.9.4

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

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  true
  GraphQL enabled:              false
  Recommended:                  true
  All:                          false

Rule name

lint/complexity/useArrowFunction

Playground link

https://biomejs.dev/playground/?code=LwAvACAAYgBpAG8AbQBlAC0AaQBnAG4AbwByAGUAIABsAGkAbgB0AC8AYwBvAG0AcABsAGUAeABpAHQAeQAvAHUAcwBlAEEAcgByAG8AdwBGAHUAbgBjAHQAaQBvAG4AOgAgAFQAaABpAHMAIABjAG8AbQBtAGUAbgB0ACAAZABvAGUAcwAgAG4AbwB0ACAAdwBvAHIAawAgAHcAaQB0AGgAIABhAG4AIABpAG4AbgBlAHIAIABjAG8AbQBtAGUAbgB0ACAAaQBuACAAdABoAGUAIABmAHUAbgBjAHQAaQBvAG4ACgBjAG8AbgBzAHQAIABmAG8AbwAwACAAPQAgAGYAdQBuAGMAdABpAG8AbgAgACgAYgBhAHIAOgAgAHMAdAByAGkAbgBnACkAIAB7AAoACQAvAC8AIABiAGkAbwBtAGUALQBpAGcAbgBvAHIAZQAgAGwAaQBuAHQALwBzAHQAeQBsAGUALwBuAG8AUABhAHIAYQBtAGUAdABlAHIAQQBzAHMAaQBnAG4AOgAgAFQAaABpAHMAIABjAG8AbQBtAGUAbgB0ACAAdwBvAHIAawBzAAoACQBiAGEAcgAgAD0AIAAiAGIAYQB6ACIAOwAKAH0AOwAKAAoAYwBvAG4AcwB0ACAAZgBvAG8AMQAgAD0AIABmAHUAbgBjAHQAaQBvAG4AIAAoAGIAYQBy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ACgAgACAAIAAgAC8ALwAgAGIAaQBvAG0AZQAtAGkAZwBuAG8AcgBlACAAbABpAG4AdAAvAHMAdQBzAHAAaQBjAGkAbwB1AHMALwBuAG8ARQB4AHAAbABpAGMAaQB0AEEAbgB5ADoAIABUAGgAaQBzACAAYwBvAG0AbQBlAG4AdAAgAHcAbwByAGsAcwAKACAAIAAgACAAbABlAHQAIABiAGEAcgA6ACAAYQBuAHkAOwAKAH0AOwAKAA%3D%3D

Expected result

The biome-ignore directive should consistently suppress linting errors regardless of inner comments.

Code of Conduct

maxmorozoff commented 5 days ago

There is a workaround if someone needs to ignore warnings in similar cases: https://github.com/opennextjs/opennextjs-aws/pull/628#discussion_r1840029787

fireairforce commented 4 days ago

i'd like to work on this.