Skip to content

Commit 0ce0281

Browse files
fix linting issues
1 parent 603ad42 commit 0ce0281

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('ReactHooksWithNoopRenderer', () => {
129129
// Schedule some updates
130130
ReactNoop.batchedUpdates(() => {
131131
counter.current.updateCount(1);
132-
counter.current.updateCount((count) => count + 10);
132+
counter.current.updateCount(count => count + 10);
133133
});
134134

135135
// Partially flush without committing
@@ -240,7 +240,7 @@ describe('ReactHooksWithNoopRenderer', () => {
240240
expect(Scheduler).toHaveYielded(['Count: 1']);
241241
expect(ReactNoop.getChildren()).toEqual([span('Count: 1')]);
242242

243-
act(() => counter.current.updateCount((count) => count + 10));
243+
act(() => counter.current.updateCount(count => count + 10));
244244
expect(Scheduler).toHaveYielded(['Count: 11']);
245245
expect(ReactNoop.getChildren()).toEqual([span('Count: 11')]);
246246
});
@@ -304,7 +304,7 @@ describe('ReactHooksWithNoopRenderer', () => {
304304

305305
const secondUpdater = updater;
306306

307-
act(() => firstUpdater((count) => count + 10));
307+
act(() => firstUpdater(count => count + 10));
308308
expect(Scheduler).toHaveYielded(['Count: 11']);
309309
expect(ReactNoop.getChildren()).toEqual([span('Count: 11')]);
310310

@@ -441,7 +441,7 @@ describe('ReactHooksWithNoopRenderer', () => {
441441

442442
function Bar({triggerUpdate}) {
443443
if (triggerUpdate) {
444-
setStep((x) => x + 1);
444+
setStep(x => x + 1);
445445
}
446446
return <Text text="Bar" />;
447447
}
@@ -519,9 +519,9 @@ describe('ReactHooksWithNoopRenderer', () => {
519519
function Counter({row: newRow}) {
520520
const [count, setCount] = useState(0);
521521
if (count < 12) {
522-
setCount((c) => c + 1);
523-
setCount((c) => c + 1);
524-
setCount((c) => c + 1);
522+
setCount(c => c + 1);
523+
setCount(c => c + 1);
524+
setCount(c => c + 1);
525525
}
526526
Scheduler.unstable_yieldValue('Render: ' + count);
527527
return <Text text={count} />;
@@ -662,7 +662,7 @@ describe('ReactHooksWithNoopRenderer', () => {
662662

663663
// Increment a counter every time the signal changes
664664
if (signal !== newSignal) {
665-
setCounter((c) => c + 1);
665+
setCounter(c => c + 1);
666666
setSignal(newSignal);
667667
if (counter === 0) {
668668
// We're suspending during a render that includes render phase
@@ -715,7 +715,7 @@ describe('ReactHooksWithNoopRenderer', () => {
715715

716716
// Increment a counter every time the signal changes
717717
if (signal !== newSignal) {
718-
setCounter((c) => c + 1);
718+
setCounter(c => c + 1);
719719
setSignal(newSignal);
720720
}
721721

@@ -796,7 +796,7 @@ describe('ReactHooksWithNoopRenderer', () => {
796796

797797
if (counter === 0) {
798798
startTransition(() => {
799-
setCounter((c) => c + 1);
799+
setCounter(c => c + 1);
800800
});
801801
}
802802

@@ -866,7 +866,7 @@ describe('ReactHooksWithNoopRenderer', () => {
866866
}
867867

868868
function Counter(props, ref) {
869-
const [count, dispatch] = useReducer(reducer, props, (p) => {
869+
const [count, dispatch] = useReducer(reducer, props, p => {
870870
Scheduler.unstable_yieldValue('Init');
871871
return p.initialCount;
872872
});
@@ -1297,7 +1297,7 @@ describe('ReactHooksWithNoopRenderer', () => {
12971297
]);
12981298

12991299
// Update children.
1300-
setChildStates.forEach((setChildState) => setChildState(1));
1300+
setChildStates.forEach(setChildState => setChildState(1));
13011301
expect(Scheduler).toFlushAndYieldThrough([
13021302
'Child one render',
13031303
'Child two render',
@@ -1306,7 +1306,7 @@ describe('ReactHooksWithNoopRenderer', () => {
13061306
]);
13071307

13081308
// Schedule another update for children, and partially process it.
1309-
setChildStates.forEach((setChildState) => setChildState(2));
1309+
setChildStates.forEach(setChildState => setChildState(2));
13101310
expect(Scheduler).toFlushAndYieldThrough(['Child one render']);
13111311

13121312
// Schedule unmount for the parent that unmounts children with pending update.
@@ -1320,7 +1320,7 @@ describe('ReactHooksWithNoopRenderer', () => {
13201320
]);
13211321

13221322
// Schedule updates for children too (which should be ignored)
1323-
setChildStates.forEach((setChildState) => setChildState(2));
1323+
setChildStates.forEach(setChildState => setChildState(2));
13241324
expect(Scheduler).toFlushAndYield([
13251325
'Child one passive destroy',
13261326
'Child two passive destroy',
@@ -2324,7 +2324,7 @@ describe('ReactHooksWithNoopRenderer', () => {
23242324
let LogOnlyErrorBoundary;
23252325

23262326
beforeEach(() => {
2327-
BrokenUseEffectCleanup = function () {
2327+
BrokenUseEffectCleanup = function() {
23282328
useEffect(() => {
23292329
Scheduler.unstable_yieldValue('BrokenUseEffectCleanup useEffect');
23302330
return () => {
@@ -2812,10 +2812,9 @@ describe('ReactHooksWithNoopRenderer', () => {
28122812

28132813
function Counter({incrementBy}) {
28142814
const [count, updateCount] = useState(0);
2815-
const increment = useCallback(
2816-
() => updateCount((c) => c + incrementBy),
2817-
[incrementBy],
2818-
);
2815+
const increment = useCallback(() => updateCount(c => c + incrementBy), [
2816+
incrementBy,
2817+
]);
28192818
return (
28202819
<>
28212820
<IncrementButton increment={increment} ref={button} />
@@ -2974,7 +2973,7 @@ describe('ReactHooksWithNoopRenderer', () => {
29742973
let ping;
29752974
function App() {
29762975
ping = useDebouncedCallback(
2977-
(value) => {
2976+
value => {
29782977
Scheduler.unstable_yieldValue('ping: ' + value);
29792978
},
29802979
100,

0 commit comments

Comments
 (0)