Skip to content

Commit ffe1529

Browse files
authored
Merge pull request #4858 from preactjs/bump-deps-2
Bump testing/transpilation/formatting deps
2 parents c3151f5 + 6cf36f6 commit ffe1529

24 files changed

+1504
-1996
lines changed

biome.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,27 @@
77
"lineEnding": "lf",
88
"lineWidth": 80,
99
"attributePosition": "auto",
10-
"ignore": [
11-
"**/.DS_Store",
12-
"**/node_modules",
13-
"**/npm-debug.log",
14-
"**/dist",
15-
"*/package-lock.json",
16-
"**/yarn.lock",
17-
"**/.vscode",
18-
"**/.idea",
19-
"test/ts/**/*.js",
20-
"**/coverage",
21-
"**/*.sw[op]",
22-
"**/*.log",
23-
"**/package/",
24-
"**/preact-*.tgz",
25-
"**/preact.tgz",
26-
"**/package-lock.json"
10+
"includes": [
11+
"**",
12+
"!**/.DS_Store",
13+
"!**/node_modules",
14+
"!**/npm-debug.log",
15+
"!**/dist",
16+
"!**/*/package-lock.json",
17+
"!**/yarn.lock",
18+
"!**/.vscode",
19+
"!**/.idea",
20+
"!**/test/ts/**/*.js",
21+
"!**/coverage",
22+
"!**/*.sw\\[op\\]",
23+
"!**/*.log",
24+
"!**/package/",
25+
"!**/preact-*.tgz",
26+
"!**/preact.tgz",
27+
"!**/package-lock.json"
2728
]
2829
},
29-
"organizeImports": { "enabled": true },
30+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
3031
"linter": { "enabled": true, "rules": { "recommended": true } },
3132
"javascript": {
3233
"formatter": {
@@ -43,7 +44,7 @@
4344
},
4445
"overrides": [
4546
{
46-
"include": ["*.json", ".*rc", "*.yml"],
47+
"includes": ["**/*.json", "**/.*rc/**", "**/*.yml"],
4748
"formatter": { "indentWidth": 2, "indentStyle": "space" }
4849
}
4950
]

compat/test/browser/suspense.test.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ class Catcher extends Component {
3434
}
3535

3636
render(props, state) {
37-
return state.error ? (
38-
<div>Catcher did catch: {state.error.message}</div>
39-
) : (
40-
props.children
41-
);
37+
return state.error
38+
? <div>Catcher did catch: {state.error.message}</div>
39+
: props.children;
4240
}
4341
}
4442

@@ -192,13 +190,11 @@ describe('suspense', () => {
192190
};
193191
}, []);
194192

195-
return state ? (
196-
<div>{children}</div>
197-
) : (
198-
<div>
199-
<p>hi</p>
200-
</div>
201-
);
193+
return state
194+
? <div>{children}</div>
195+
: <div>
196+
<p>hi</p>
197+
</div>;
202198
};
203199

204200
render(

compat/test/ts/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
}
1515
},
1616
"include": ["./**/*.ts", "./**/*.tsx"]
17-
}
17+
}

debug/src/component-stack.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ export function setupComponentStack() {
132132
};
133133

134134
options.vnode = vnode => {
135-
ownerMap.set(vnode, ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null);
135+
ownerMap.set(
136+
vnode,
137+
ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null
138+
);
136139
if (oldVNode) oldVNode(vnode);
137140
};
138141

demo/style.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
html,
22
body {
3-
font: 14px system-ui, sans-serif;
3+
font:
4+
14px system-ui,
5+
sans-serif;
46
}
57
.list {
68
list-style: none;
@@ -13,7 +15,9 @@ body {
1315
}
1416
@keyframes fadeIn {
1517
0% {
16-
box-shadow: inset 0 0 2px 2px red, 0 0 2px 2px red;
18+
box-shadow:
19+
inset 0 0 2px 2px red,
20+
0 0 2px 2px red;
1721
}
1822
}
1923
.list > .odd {

hooks/src/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export function useReducer<S, A, I>(
6363
*/
6464
export function useRef<T>(initialValue: T): RefObject<T>;
6565
export function useRef<T>(initialValue: T | null): RefObject<T | null>;
66-
export function useRef<T>(initialValue: T | undefined): RefObject<T | undefined>;
66+
export function useRef<T>(
67+
initialValue: T | undefined
68+
): RefObject<T | undefined>;
6769

6870
type EffectCallback = () => void | (() => void);
6971
/**

hooks/test/browser/errorBoundary.test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,11 @@ describe('errorBoundary', () => {
131131

132132
function App() {
133133
const [err] = useErrorBoundary();
134-
return err ? (
135-
<p>Error</p>
136-
) : (
137-
<Child>
138-
<EffectThrowsError />
139-
</Child>
140-
);
134+
return err
135+
? <p>Error</p>
136+
: <Child>
137+
<EffectThrowsError />
138+
</Child>;
141139
}
142140

143141
render(<App />, scratch);

hooks/test/browser/useEffect.test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,9 @@ describe('useEffect', () => {
427427
}
428428

429429
render() {
430-
return this.state.error ? (
431-
<h2>Error! {this.state.error}</h2>
432-
) : (
433-
this.props.children
434-
);
430+
return this.state.error
431+
? <h2>Error! {this.state.error}</h2>
432+
: this.props.children;
435433
}
436434
}
437435

hooks/test/browser/useId.test.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,17 @@ describe('useId', () => {
168168
<main>
169169
ID: {rootId}
170170
<p>Hello world id: {paragraphId}</p>
171-
{showStateful ? (
172-
<Stateful />
173-
) : (
174-
<ChildReturn>
175-
<SomeMessage msg="child-return" />
176-
<ChildReturn>
171+
{showStateful
172+
? <Stateful />
173+
: <ChildReturn>
177174
<SomeMessage msg="child-return" />
178175
<ChildReturn>
179176
<SomeMessage msg="child-return" />
177+
<ChildReturn>
178+
<SomeMessage msg="child-return" />
179+
</ChildReturn>
180180
</ChildReturn>
181-
</ChildReturn>
182-
</ChildReturn>
183-
)}
181+
</ChildReturn>}
184182
<ChildFragmentReturn>
185183
<SomeMessage msg="child-fragment-return" />
186184
<SomeMessage msg="child-fragment-return-2" />
@@ -239,19 +237,17 @@ describe('useId', () => {
239237
<main>
240238
ID: {rootId}
241239
<p>Hello world id: {paragraphId}</p>
242-
{showStateful ? (
243-
<Stateful />
244-
) : (
245-
<ChildReturn>
246-
<SomeMessage msg="child-return" />
247-
<ChildReturn>
240+
{showStateful
241+
? <Stateful />
242+
: <ChildReturn>
248243
<SomeMessage msg="child-return" />
249244
<ChildReturn>
250245
<SomeMessage msg="child-return" />
246+
<ChildReturn>
247+
<SomeMessage msg="child-return" />
248+
</ChildReturn>
251249
</ChildReturn>
252-
</ChildReturn>
253-
</ChildReturn>
254-
)}
250+
</ChildReturn>}
255251
<ChildFragmentReturn>
256252
<SomeMessage msg="child-fragment-return" />
257253
<SomeMessage msg="child-fragment-return-2" />

hooks/test/browser/useImperativeHandle.test.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,10 @@ describe('useImperativeHandle', () => {
103103

104104
function Comp({ a }) {
105105
ref = useRef({});
106-
useImperativeHandle(
107-
ref,
108-
() => {
109-
createHandleSpy();
110-
return { test: () => 'test' + a };
111-
},
112-
[a]
113-
);
106+
useImperativeHandle(ref, () => {
107+
createHandleSpy();
108+
return { test: () => 'test' + a };
109+
}, [a]);
114110
return <p>Test</p>;
115111
}
116112

0 commit comments

Comments
 (0)