Skip to content

Commit 0493f53

Browse files
authored
chore: update prettier to v3.9.0 (#21054)
1 parent e35b05f commit 0493f53

20 files changed

Lines changed: 80 additions & 123 deletions

docs/src/assets/js/[email protected]

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
u = r.indexOf(t, i + 1),
342342
l = i;
343343
if (i >= 0 && u > 0) {
344-
for (n = [], s = r.length; l >= 0 && !c; )
344+
for (n = [], s = r.length; l >= 0 && !c;)
345345
(l == i
346346
? (n.push(l), (i = r.indexOf(e, l + 1)))
347347
: 1 == n.length
@@ -377,19 +377,19 @@
377377
}
378378
function u() {
379379
if ((i(), "/" === t[0] && "*" === t[1])) {
380-
for (var e = 2; t[e] && ("*" !== t[e] || "/" !== t[e + 1]); )
380+
for (var e = 2; t[e] && ("*" !== t[e] || "/" !== t[e + 1]);)
381381
e++;
382382
if (!t[e]) return n("end of comment is missing");
383383
var r = t.slice(2, e);
384384
return ((t = t.slice(e + 2)), { type: "comment", comment: r });
385385
}
386386
}
387387
function l() {
388-
for (var e, t = []; (e = u()); ) t.push(e);
388+
for (var e, t = []; (e = u());) t.push(e);
389389
return r.removeComments ? [] : t;
390390
}
391391
function f() {
392-
for (i(); "}" === t[0]; ) n("extra closing bracket");
392+
for (i(); "}" === t[0];) n("extra closing bracket");
393393
var e = o(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);
394394
if (e)
395395
return e[0]
@@ -426,15 +426,12 @@
426426
}
427427
function p() {
428428
if (!a()) return n("missing '{'");
429-
for (var e, t = l(); (e = d()); ) (t.push(e), (t = t.concat(l())));
429+
for (var e, t = l(); (e = d());) (t.push(e), (t = t.concat(l())));
430430
return c() ? t : n("missing '}'");
431431
}
432432
function m() {
433433
i();
434-
for (
435-
var e, t = [];
436-
(e = o(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/));
437-
)
434+
for (var e, t = []; (e = o(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/));)
438435
(t.push(e[1]), o(/^,\s*/));
439436
if (t.length)
440437
return { type: "keyframe", values: t, declarations: p() };
@@ -451,7 +448,7 @@
451448
var r,
452449
s = e[1];
453450
if (!a()) return n("@keyframes missing '{'");
454-
for (var i = l(); (r = m()); )
451+
for (var i = l(); (r = m());)
455452
(i.push(r), (i = i.concat(l())));
456453
return c()
457454
? {

docs/src/assets/js/inert-polyfill.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ window.addEventListener("load", function () {
55
function h(a, b, c) {
66
if (0 > b) {
77
if (a.previousElementSibling) {
8-
for (a = a.previousElementSibling; a.lastElementChild; )
8+
for (a = a.previousElementSibling; a.lastElementChild;)
99
a = a.lastElementChild;
1010
return a;
1111
}
1212
return a.parentElement;
1313
}
1414
if (a != c && a.firstElementChild) return a.firstElementChild;
15-
for (; null != a; ) {
15+
for (; null != a;) {
1616
if (a.nextElementSibling) return a.nextElementSibling;
1717
a = a.parentElement;
1818
}
1919
return null;
2020
}
2121
function g(a) {
22-
for (; a && a !== document.documentElement; ) {
22+
for (; a && a !== document.documentElement;) {
2323
if (a.hasAttribute("inert")) return a;
2424
a = a.parentElement;
2525
}
@@ -62,7 +62,7 @@ window.addEventListener("load", function () {
6262
Object.defineProperty(e, "keyCode", { value: 9 });
6363
document.activeElement.dispatchEvent(e);
6464
if (d != document.activeElement) return;
65-
for (d = f; ; ) {
65+
for (d = f; ;) {
6666
d = h(d, c, f);
6767
if (!d) break;
6868
a: {

docs/src/extend/custom-rules.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,7 @@ export default {
866866
create(context) {
867867
const [{ alias }] = context.options;
868868

869-
return {
870-
/* ... */
871-
};
869+
return {/* ... */};
872870
},
873871
};
874872
```

docs/src/use/configure/ignore.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ export default defineConfig([
5656
{
5757
files: ["**/*.ts"],
5858
ignores: [".config/**"],
59-
rules: {
60-
/* ... */
61-
},
59+
rules: {/* ... */},
6260
},
6361
]);
6462
```

lib/rules/func-name-matching.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ module.exports = {
250250
},
251251

252252
"Property, PropertyDefinition[value]"(node) {
253-
if (
254-
!(node.value.type === "FunctionExpression" && node.value.id)
255-
) {
253+
if (!(
254+
node.value.type === "FunctionExpression" && node.value.id
255+
)) {
256256
return;
257257
}
258258

lib/rules/generator-star-spacing.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,10 @@ module.exports = {
226226
}
227227

228228
// Only check before when preceded by `function`|`static` keyword
229-
if (
230-
!(
231-
kind === "method" &&
232-
starToken === sourceCode.getFirstToken(node.parent)
233-
)
234-
) {
229+
if (!(
230+
kind === "method" &&
231+
starToken === sourceCode.getFirstToken(node.parent)
232+
)) {
235233
checkSpacing(kind, "before", prevToken, starToken);
236234
}
237235

lib/rules/indent.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,12 +1872,10 @@ module.exports = {
18721872
},
18731873

18741874
SwitchCase(node) {
1875-
if (
1876-
!(
1877-
node.consequent.length === 1 &&
1878-
node.consequent[0].type === "BlockStatement"
1879-
)
1880-
) {
1875+
if (!(
1876+
node.consequent.length === 1 &&
1877+
node.consequent[0].type === "BlockStatement"
1878+
)) {
18811879
const caseKeyword = sourceCode.getFirstToken(node);
18821880
const tokenAfterCurrentCase =
18831881
sourceCode.getTokenAfter(node);

lib/rules/key-spacing.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,10 @@ module.exports = {
380380
*/
381381
function isKeyValueProperty(property) {
382382
return !(
383-
(
384-
property.method ||
385-
property.shorthand ||
386-
property.kind !== "init" ||
387-
property.type !== "Property"
388-
) // Could be "ExperimentalSpreadProperty" or "SpreadElement"
383+
property.method ||
384+
property.shorthand ||
385+
property.kind !== "init" ||
386+
property.type !== "Property" // Could be "ExperimentalSpreadProperty" or "SpreadElement"
389387
);
390388
}
391389

lib/rules/no-mixed-spaces-and-tabs.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,12 @@ module.exports = {
125125
sourceCode.getIndexFromLoc(loc.start),
126126
);
127127

128-
if (
129-
!(
130-
containingNode &&
131-
["Literal", "TemplateElement"].includes(
132-
containingNode.type,
133-
)
128+
if (!(
129+
containingNode &&
130+
["Literal", "TemplateElement"].includes(
131+
containingNode.type,
134132
)
135-
) {
133+
)) {
136134
context.report({
137135
node,
138136
loc,

lib/rules/no-promise-executor-return.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,11 @@ module.exports = {
200200
}
201201

202202
// Do not suggest wrapping an unnamed function or class expression in braces as that would be invalid syntax.
203-
if (
204-
!(
205-
(node.body.type === "FunctionExpression" ||
206-
node.body.type === "ClassExpression") &&
207-
!node.body.id
208-
)
209-
) {
203+
if (!(
204+
(node.body.type === "FunctionExpression" ||
205+
node.body.type === "ClassExpression") &&
206+
!node.body.id
207+
)) {
210208
suggest.push({
211209
messageId: "wrapBraces",
212210
fix(fixer) {

0 commit comments

Comments
 (0)