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

📝 Line width is not respected for functions that return template literals #4121

Closed
1 task done
costinsin opened this issue Sep 29, 2024 · 0 comments · Fixed by #4229 or WomB0ComB0/portfolio#159
Closed
1 task done
Assignees
Labels
A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@costinsin
Copy link

Environment information

CLI:
  Version:                      1.9.2
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "screen-256color"
  JS_RUNTIME_VERSION:           "v20.15.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.7.0"

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

Formatter:
  Format with errors:           false
  Indent style:                 Space
  Indent width:                 4
  Line ending:                  Lf
  Line width:                   100
  Attribute position:           Auto
  Bracket spacing:              BracketSpacing(true)
  Ignore:                       ["build", "node_modules"]
  Include:                      []

JavaScript Formatter:
  Enabled:                      false
  JSX quote style:              Double
  Quote properties:             AsNeeded
  Trailing commas:              All
  Semicolons:                   Always
  Arrow parentheses:            Always
  Bracket spacing:              BracketSpacing(true)
  Bracket same line:            false
  Quote style:                  Double
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   100
  Attribute position:           Auto

JSON Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

CSS Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Double

GraphQL Formatter:
  Enabled:                      false
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Workspace:
  Open Documents:               0

Configuration

{
    "$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
    "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
    "files": { "ignoreUnknown": false, "ignore": [] },
    "formatter": {
        "enabled": true,
        "useEditorconfig": true,
        "formatWithErrors": false,
        "indentStyle": "space",
        "indentWidth": 4,
        "lineEnding": "lf",
        "lineWidth": 100,
        "attributePosition": "auto",
        "bracketSpacing": true,
        "ignore": ["build", "node_modules"]
    },
    "organizeImports": { "enabled": true },
    "linter": {
        "enabled": true,
        "rules": {
            "recommended": false,
            "complexity": {
                "noBannedTypes": "error",
                "noExtraBooleanCast": "error",
                "noMultipleSpacesInRegularExpressionLiterals": "error",
                "noUselessCatch": "error",
                "noUselessTypeConstraint": "error",
                "noWith": "error"
            },
            "correctness": {
                "noConstAssign": "error",
                "noConstantCondition": "error",
                "noEmptyCharacterClassInRegex": "error",
                "noEmptyPattern": "error",
                "noGlobalObjectCalls": "error",
                "noInnerDeclarations": "error",
                "noInvalidConstructorSuper": "error",
                "noNewSymbol": "error",
                "noNonoctalDecimalEscape": "error",
                "noPrecisionLoss": "error",
                "noSelfAssign": "error",
                "noSetterReturn": "error",
                "noSwitchDeclarations": "error",
                "noUndeclaredVariables": "error",
                "noUnreachable": "error",
                "noUnreachableSuper": "error",
                "noUnsafeFinally": "error",
                "noUnsafeOptionalChaining": "error",
                "noUnusedLabels": "error",
                "noUnusedVariables": "error",
                "useArrayLiterals": "off",
                "useIsNan": "error",
                "useValidForDirection": "error",
                "useYield": "error"
            },
            "style": { "noNamespace": "error", "useAsConstAssertion": "error" },
            "suspicious": {
                "noAsyncPromiseExecutor": "error",
                "noCatchAssign": "error",
                "noClassAssign": "error",
                "noCompareNegZero": "error",
                "noConsole": "error",
                "noControlCharactersInRegex": "error",
                "noDebugger": "error",
                "noDuplicateCase": "error",
                "noDuplicateClassMembers": "error",
                "noDuplicateObjectKeys": "error",
                "noDuplicateParameters": "error",
                "noEmptyBlockStatements": "error",
                "noExplicitAny": "error",
                "noExtraNonNullAssertion": "error",
                "noFallthroughSwitchClause": "error",
                "noFunctionAssign": "error",
                "noGlobalAssign": "error",
                "noImportAssign": "error",
                "noMisleadingCharacterClass": "error",
                "noMisleadingInstantiator": "error",
                "noPrototypeBuiltins": "error",
                "noRedeclare": "error",
                "noShadowRestrictedNames": "error",
                "noSparseArray": "error",
                "noUnsafeDeclarationMerging": "error",
                "noUnsafeNegation": "error",
                "useGetterReturn": "error",
                "useValidTypeof": "error"
            }
        },
        "ignore": [
            "**/.eslintrc.cjs",
            "**/node_modules",
            "**/build"
        ]
    },
    "javascript": {
        "formatter": {
            "jsxQuoteStyle": "double",
            "quoteProperties": "asNeeded",
            "trailingCommas": "all",
            "semicolons": "always",
            "arrowParentheses": "always",
            "bracketSameLine": false,
            "quoteStyle": "double",
            "attributePosition": "auto",
            "bracketSpacing": true,
            "lineWidth": 100
        }
    },
    "overrides": [
        {
            "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
            "linter": {
                "rules": {
                    "correctness": {
                        "noConstAssign": "off",
                        "noGlobalObjectCalls": "off",
                        "noInvalidBuiltinInstantiation": "off",
                        "noInvalidConstructorSuper": "off",
                        "noNewSymbol": "off",
                        "noSetterReturn": "off",
                        "noUndeclaredVariables": "off",
                        "noUnreachable": "off",
                        "noUnreachableSuper": "off"
                    },
                    "style": {
                        "noArguments": "error",
                        "noVar": "error",
                        "useConst": "error"
                    },
                    "suspicious": {
                        "noDuplicateClassMembers": "off",
                        "noDuplicateObjectKeys": "off",
                        "noDuplicateParameters": "off",
                        "noFunctionAssign": "off",
                        "noImportAssign": "off",
                        "noRedeclare": "off",
                        "noUnsafeNegation": "off",
                        "useGetterReturn": "off"
                    }
                }
            }
        },
        {
            "include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
            "linter": {
                "rules": {
                    "correctness": {
                        "noConstAssign": "off",
                        "noGlobalObjectCalls": "off",
                        "noInvalidBuiltinInstantiation": "off",
                        "noInvalidConstructorSuper": "off",
                        "noNewSymbol": "off",
                        "noSetterReturn": "off",
                        "noUndeclaredVariables": "off",
                        "noUnreachable": "off",
                        "noUnreachableSuper": "off"
                    },
                    "style": {
                        "noArguments": "error",
                        "noVar": "error",
                        "useConst": "error"
                    },
                    "suspicious": {
                        "noDuplicateClassMembers": "off",
                        "noDuplicateObjectKeys": "off",
                        "noDuplicateParameters": "off",
                        "noFunctionAssign": "off",
                        "noImportAssign": "off",
                        "noRedeclare": "off",
                        "noUnsafeNegation": "off",
                        "useGetterReturn": "off"
                    }
                }
            }
        }
    ]
}

Playground link

https://biomejs.dev/playground/?lineWidth=100&indentStyle=space&indentWidth=4&code=YwBvAG4AcwB0ACAAQQBfAEMATwBOAFMAVABBAE4AVABfAEYAVQBOAEMAVABJAE8ATgBfAFQASABBAFQAXwBUAEEASwBFAFMAXwBPAE4ARQBfAEEAUgBHAFUATQBFAE4AVAAgAD0AIAAoAAoAIAAgACAAIABzAG8AbQBlAEEAcgBnAHUAbQBlAG4AdAA6ACAAcwB0AHIAaQBuAGcALAAKACkAIAA9AD4AIABgAFMAbwBtAGUAdABoAGkAbgBnACAAdABoAGEAdAAgAGkAcwAgAHYAZQByAHkAIABsAG8AbgBnACAAYQBuAGQAIABzAGgAbwB1AGwAZAAgAGIAZQAgAHAAcgBpAG4AdABlAGQAIABvAG4AIAB0AGgAZQAgAG4AZQB4AHQAIABsAGkAbgBlACAAYgBlAGMAYQB1AHMAZQAgAGkAdAAnAHMAIABiAGkAZwBnAGUAcgAgAHQAaABhAG4AIABsAGkAbgBlACAAdwBpAGQAdABoAC4ACgAKAFcAaAB5ACAAZABvAGUAcwBuACcAdAAgAGkAdAAgAHQAaABvAD8ACgBgADsA

Code of Conduct

  • I agree to follow Biome's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
3 participants