From abc2a7e056ac7e8966fd589780a6c5e3f17eb644 Mon Sep 17 00:00:00 2001 From: Mateusz Kadlubowski Date: Tue, 10 Dec 2024 11:47:28 +0800 Subject: [PATCH] fix Prettier issue --- .../phases/2-analyze/css/css-prune.js | 6 +++++- .../compiler/phases/2-analyze/css/css-warn.js | 20 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js b/packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js index a25f709728af..35bc675166ae 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js +++ b/packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js @@ -69,7 +69,11 @@ export function prune(stylesheet, element) { seen.clear(); if ( - apply_selector(selectors, /** @type {Compiler.AST.CSS.Rule} */ (node.metadata.rule), element) + apply_selector( + selectors, + /** @type {Compiler.AST.CSS.Rule} */ (node.metadata.rule), + element + ) ) { node.metadata.used = true; } diff --git a/packages/svelte/src/compiler/phases/2-analyze/css/css-warn.js b/packages/svelte/src/compiler/phases/2-analyze/css/css-warn.js index eb0d5fe4f17b..238c83f00ed1 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/css/css-warn.js +++ b/packages/svelte/src/compiler/phases/2-analyze/css/css-warn.js @@ -1,8 +1,8 @@ /** @import { Visitors } from 'zimmerframe' */ /** @import { AST } from '#compiler' */ -import { walk } from "zimmerframe"; -import * as w from "../../../warnings.js"; -import { is_keyframes_node } from "../../css.js"; +import { walk } from 'zimmerframe'; +import * as w from '../../../warnings.js'; +import { is_keyframes_node } from '../../css.js'; /** * @param {AST.CSS.StyleSheet} stylesheet @@ -19,7 +19,7 @@ const visitors = { } }, PseudoClassSelector(node, context) { - if (node.name === "is" || node.name === "where") { + if (node.name === 'is' || node.name === 'where') { context.next(); } }, @@ -27,15 +27,11 @@ const visitors = { if ( !node.metadata.used && // prevent double-marking of `.unused:is(.unused)` - (context.path.at(-2)?.type !== "PseudoClassSelector" || - /** @type {AST.CSS.ComplexSelector} */ (context.path.at(-4))?.metadata - .used) + (context.path.at(-2)?.type !== 'PseudoClassSelector' || + /** @type {AST.CSS.ComplexSelector} */ (context.path.at(-4))?.metadata.used) ) { const content = context.state.stylesheet.content; - const text = content.styles.substring( - node.start - content.start, - node.end - content.start, - ); + const text = content.styles.substring(node.start - content.start, node.end - content.start); w.css_unused_selector(node, text); } @@ -47,5 +43,5 @@ const visitors = { } else { context.next(); } - }, + } };