From 80584910387cd928264af26533911a085ff7a5af Mon Sep 17 00:00:00 2001 From: tjtanjin Date: Sat, 12 Oct 2024 02:42:20 +0800 Subject: [PATCH] lint: Fix lint issues --- src/services/ThemeService.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/services/ThemeService.ts b/src/services/ThemeService.ts index af416552..4efb88b6 100644 --- a/src/services/ThemeService.ts +++ b/src/services/ThemeService.ts @@ -156,22 +156,22 @@ export const processAndFetchThemeConfig = async (botId: string, theme: Theme): */ const getScopedCssStylesText = (botId: string, cssStylesText: string) => { const scopedCssText = cssStylesText.split(/(?<=})/) - .map(rule => { - const trimmedRule = rule.trim(); - // ignores comments - if (trimmedRule.startsWith('/*')) { + .map(rule => { + const trimmedRule = rule.trim(); + // ignores comments + if (trimmedRule.startsWith('/*')) { return trimmedRule; } - // ignores imports, keyframes and media queries - if (trimmedRule.startsWith('@import') || trimmedRule.startsWith('@keyframes') + // ignores imports, keyframes and media queries + if (trimmedRule.startsWith('@import') || trimmedRule.startsWith('@keyframes') || trimmedRule.startsWith('@media')) { - return trimmedRule; - } + return trimmedRule; + } - // scopes regular css rules with bot id - return trimmedRule ? `#${botId} ${trimmedRule}` : ''; - }) - .join('\n'); + // scopes regular css rules with bot id + return trimmedRule ? `#${botId} ${trimmedRule}` : ''; + }) + .join('\n'); return scopedCssText; }