๐Ÿš€ Grammar-Aware Code Formatter: Structure through separation (supports Go, JavaScript, TypeScript, JSX, and TSX)
go formatter code-formatter javascript typescript jsx tsx
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

style: Fix lint warnings

Fuwn 2d0a6ba5 f37a1ee1

+5 -10
+2 -7
adapter_ecmascript.go
··· 127 127 classified = classified[7:] 128 128 } 129 129 130 - if strings.HasPrefix(classified, "async ") { 131 - classified = classified[6:] 132 - } 133 - 134 - if strings.HasPrefix(classified, "declare ") { 135 - classified = classified[8:] 136 - } 130 + classified = strings.TrimPrefix(classified, "async ") 131 + classified = strings.TrimPrefix(classified, "declare ") 137 132 138 133 switch { 139 134 case ecmaScriptStatementHasPrefix(classified, "function"):
+3 -3
engine/engine.go
··· 54 54 55 55 if hasWrittenContent && !previousWasOpenBrace && !event.IsClosingBrace && !event.IsCaseLabel && !event.IsContinuation { 56 56 if currentIsTopLevel && previousWasTopLevel && currentStatementType != previousStatementType { 57 - if !(e.CommentMode == CommentsFollow && previousWasComment) { 57 + if e.CommentMode != CommentsFollow || !previousWasComment { 58 58 needsBlankLine = true 59 59 } 60 60 } else if event.HasASTInfo && (currentIsScoped || previousWasScoped) { 61 61 if e.GroupSingleLineScopes && currentIsSingleLineScope && previousWasSingleLineScope && currentStatementType == previousStatementType { 62 62 needsBlankLine = false 63 - } else if !(e.CommentMode == CommentsFollow && previousWasComment) { 63 + } else if e.CommentMode != CommentsFollow || !previousWasComment { 64 64 needsBlankLine = true 65 65 } 66 66 } else if currentStatementType != "" && previousStatementType != "" && currentStatementType != previousStatementType { 67 - if !(e.CommentMode == CommentsFollow && previousWasComment) { 67 + if e.CommentMode != CommentsFollow || !previousWasComment { 68 68 needsBlankLine = true 69 69 } 70 70 }