Skip to content

Commit abc2a7e

Browse files
committed
fix Prettier issue
1 parent e185e1a commit abc2a7e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export function prune(stylesheet, element) {
6969
seen.clear();
7070

7171
if (
72-
apply_selector(selectors, /** @type {Compiler.AST.CSS.Rule} */ (node.metadata.rule), element)
72+
apply_selector(
73+
selectors,
74+
/** @type {Compiler.AST.CSS.Rule} */ (node.metadata.rule),
75+
element
76+
)
7377
) {
7478
node.metadata.used = true;
7579
}

packages/svelte/src/compiler/phases/2-analyze/css/css-warn.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @import { Visitors } from 'zimmerframe' */
22
/** @import { AST } from '#compiler' */
3-
import { walk } from "zimmerframe";
4-
import * as w from "../../../warnings.js";
5-
import { is_keyframes_node } from "../../css.js";
3+
import { walk } from 'zimmerframe';
4+
import * as w from '../../../warnings.js';
5+
import { is_keyframes_node } from '../../css.js';
66

77
/**
88
* @param {AST.CSS.StyleSheet} stylesheet
@@ -19,23 +19,19 @@ const visitors = {
1919
}
2020
},
2121
PseudoClassSelector(node, context) {
22-
if (node.name === "is" || node.name === "where") {
22+
if (node.name === 'is' || node.name === 'where') {
2323
context.next();
2424
}
2525
},
2626
ComplexSelector(node, context) {
2727
if (
2828
!node.metadata.used &&
2929
// prevent double-marking of `.unused:is(.unused)`
30-
(context.path.at(-2)?.type !== "PseudoClassSelector" ||
31-
/** @type {AST.CSS.ComplexSelector} */ (context.path.at(-4))?.metadata
32-
.used)
30+
(context.path.at(-2)?.type !== 'PseudoClassSelector' ||
31+
/** @type {AST.CSS.ComplexSelector} */ (context.path.at(-4))?.metadata.used)
3332
) {
3433
const content = context.state.stylesheet.content;
35-
const text = content.styles.substring(
36-
node.start - content.start,
37-
node.end - content.start,
38-
);
34+
const text = content.styles.substring(node.start - content.start, node.end - content.start);
3935
w.css_unused_selector(node, text);
4036
}
4137

@@ -47,5 +43,5 @@ const visitors = {
4743
} else {
4844
context.next();
4945
}
50-
},
46+
}
5147
};

0 commit comments

Comments
 (0)