[llvm-bugs] [Bug 50503] New: JavaScript / TypeScript AllowShortLambdasOnASingleLine doesn't work

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 27 00:41:24 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50503

            Bug ID: 50503
           Summary: JavaScript / TypeScript AllowShortLambdasOnASingleLine
                    doesn't work
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jkopecky at sievers-group.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

AllowShortLambdasOnASingleLine: 'false'

doesn't work when the function is surrounded by () braces:

```JavaScript
const sampleBraces = (() => {return 25})

const sampleNoBraces = () => {
    return 25
}
```

(I already opened ID 50501, because the curl braces are not on the new line)


my setting:
```
---
Language:        JavaScript
BasedOnStyle:    Chromium
ColumnLimit:     100
BreakBeforeBraces: Allman

AlignConsecutiveAssignments: 'true'
AlignConsecutiveMacros: 'true'
AlignConsecutiveDeclarations: 'true'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLambdasOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeColon
AlwaysBreakTemplateDeclarations: Yes
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
DerivePointerAlignment: 'false'
IncludeBlocks: Preserve
IndentCaseLabels: 'false'
IndentWidth: '4'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: 'None'
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SortIncludes: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpacesInAngles: false
SpacesInContainerLiterals: false
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInParentheses: 'false'
TabWidth: '4'
UseTab: Never

```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210527/04af1ea3/attachment.html>


More information about the llvm-bugs mailing list