biome icon indicating copy to clipboard operation
biome copied to clipboard

Arrow function as object value inside another arrow function, returning function, gets weird whitespace

Open MrTact opened this issue 1 year ago • 4 comments

Environment information

CLI:
  Version:                      0.0.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:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

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

Workspace:
  Open Documents:               0

Configuration

{
  "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
  "organizeImports": {
    "enabled": false
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "complexity": {
        "noForEach": "off",
      },
      "correctness": {
        "useExhaustiveDependencies": "off"
      },
      "nursery": {
        "useAwait": "off"
      },
      "suspicious": {
        "noExplicitAny": "off"
      }
    }
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "trailingComma": "es5"
    }
  }
}

Playground link

https://biomejs.dev/playground/?indentStyle=space&quoteStyle=single&jsxQuoteStyle=single&trailingComma=es5&code=agBlAHMAdAAuAG0AbwBjAGsAKAAnAFUAdABpAGwALwBoAG8AbwBrAHMALwB1AHMAZQBVAHAAbABvAGEAZABGAGkAbABlAC8AdQBzAGUAUwBpAG0AcABsAGUARgBpAGwAZQBVAHAAbABvAGEAZAAnACwAIAAoACkAIAA9AD4AIAAoAHsACgAgACAAdQBzAGUAUwBpAG0AcABsAGUARgBpAGwAZQBVAHAAbABvAGEAZAA6ACAAKAApACAAPQA+ACAAKAAKACAAIAAgACAAcwBlAGwAZQBjAHQAZQBkAEYAaQBsAGUAOgAgAEYAaQBsAGUALAAKACAAIAAgACAAcwB0AGEAdABlADoAIABTAG8AbQBlAFIAZQBhAGwAbAB5AEwAbwBuAGcAUwB0AGEAdABlACwACgAgACAAIAAgAHQAeQBwAGUAOgAgAFMAbwBtAGUAUgBlAGEAbABsAHkATABvAG4AZwBUAHkAcABlAAoAIAAgACkAIAA9AD4AIAB7AAoAIAAgACAAIAAgACAAbQBvAGMAawBlAGQAUwBpAG0AcABsAGUARgBpAGwAZQBVAHAAbABvAGEAZAAoAHMAZQBsAGUAYwB0AGUAZABGAGkAbABlACwAIABzAHQAYQB0AGUALAAgAHQAeQBwAGUAKQA7AAoACgAgACAAIAAgACAAIAByAGUAdAB1AHIAbgAgAFAAcgBvAG0AaQBzAGUALgByAGUAcwBvAGwAdgBlACgAKQA7AAoAIAAgACAAIAB9ACwACgB9ACkAKQA7AAoA

Code of Conduct

  • [X] I agree to follow Biome's Code of Conduct

MrTact avatar Dec 11 '23 15:12 MrTact

Urgh, looking at it more closely, prettier does basically the same thing. Closing this.

MrTact avatar Dec 11 '23 15:12 MrTact

Actually, I lied. Prettier produces a whitespace difference here, so this is a legit test case for Prettier compatibility.

MrTact avatar Dec 11 '23 15:12 MrTact

The playground link seems to be broken

ematipico avatar Dec 11 '23 15:12 ematipico

@MrTact Could you update the playground link? Without a proper repro we cannot address the issue.

Conaclos avatar May 06 '24 11:05 Conaclos