From e8c7e7520f3fcd407eff2f86ee5d39e55c7a38ee Mon Sep 17 00:00:00 2001 From: LinkinStars Date: Wed, 18 Oct 2023 13:08:12 +0800 Subject: [PATCH] feat(plugin): delete \n when no plugins --- internal/cli/build.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cli/build.go b/internal/cli/build.go index c3bcba62a..95cc1ddf6 100644 --- a/internal/cli/build.go +++ b/internal/cli/build.go @@ -276,7 +276,11 @@ func getFolders(dir string) ([]string, error) { func generateIndexTsContent(folders []string) string { builder := &strings.Builder{} - builder.WriteString("export default null;\n\n") + builder.WriteString("export default null;\n") + // Line 2:1: Delete `⏎` prettier/prettier + if len(folders) > 0 { + builder.WriteString("\n") + } for _, folder := range folders { builder.WriteString(fmt.Sprintf("export { default as %s } from '%s';\n", folder, folder)) }