Skip to content

Commit 2ffa66f

Browse files
committed
Remove invalid React Compiler expectedErrors annotations
This commit removes expectedErrors metadata from code block fences that were incorrectly added during the sync process. These annotations (e.g., {expectedErrors: {'react-compiler': [5]}}) were meant to document expected compiler diagnostics, but the React Compiler is not actually reporting errors on those lines. The upstream English react.dev repository does not have these annotations either, confirming they should not be present in the Bengali translation. Changes made: - Ran `yarn lint:fix` to auto-fix all expectedErrors mismatches - 34 markdown files updated (79 lines changed) - Only code fence metadata modified - no translation content affected - All Bengali translations remain completely intact This fixes the site_lint CI check that was failing due to: "React Compiler expected error on line X was not triggered" The ESLint local rules plugin validates that expectedErrors annotations match actual compiler diagnostics. When errors aren't triggered, the annotations are automatically removed to maintain accuracy.
1 parent 12c7814 commit 2ffa66f

34 files changed

+79
-79
lines changed

src/content/learn/describing-the-ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ h2 { font-size: 20px; }
474474

475475
<Sandpack>
476476

477-
```js {expectedErrors: {'react-compiler': [5]}}
477+
```js
478478
let guest = 0;
479479

480480
function Cup() {

src/content/learn/escape-hatches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Effect হল React এর জগত থেকে একটি escape hatch।
201201

202202
উদাহরণস্বরূপ, একটা state এর উপর নির্ভর করে আরেকটা state পরিবর্তন করতে আপনার Effect এর প্রয়োজন নেইঃ
203203

204-
```js {expectedErrors: {'react-compiler': [8]}} {5-9}
204+
```js {5-9}
205205
function Form() {
206206
const [firstName, setFirstName] = useState('Taylor');
207207
const [lastName, setLastName] = useState('Swift');

src/content/learn/keeping-components-pure.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ React এর রেন্ডারিং প্রসেস সবসময় ব
9393

9494
<Sandpack>
9595

96-
```js {expectedErrors: {'react-compiler': [5]}}
96+
```js
9797
let guest = 0;
9898

9999
function Cup() {
@@ -380,7 +380,7 @@ The buggy code is in `Profile.js`. Make sure you read it all from top to bottom!
380380

381381
<Sandpack>
382382

383-
```js {expectedErrors: {'react-compiler': [7]}} src/Profile.js
383+
```js src/Profile.js
384384
import Panel from './Panel.js';
385385
import { getImageUrl } from './utils.js';
386386

@@ -602,7 +602,7 @@ export default function StoryTray({ stories }) {
602602
}
603603
```
604604

605-
```js {expectedErrors: {'react-compiler': [16]}} src/App.js hidden
605+
```js src/App.js hidden
606606
import { useState, useEffect } from 'react';
607607
import StoryTray from './StoryTray.js';
608608

@@ -698,7 +698,7 @@ export default function StoryTray({ stories }) {
698698
}
699699
```
700700

701-
```js {expectedErrors: {'react-compiler': [16]}} src/App.js hidden
701+
```js src/App.js hidden
702702
import { useState, useEffect } from 'react';
703703
import StoryTray from './StoryTray.js';
704704

@@ -790,7 +790,7 @@ export default function StoryTray({ stories }) {
790790
}
791791
```
792792

793-
```js {expectedErrors: {'react-compiler': [16]}} src/App.js hidden
793+
```js src/App.js hidden
794794
import { useState, useEffect } from 'react';
795795
import StoryTray from './StoryTray.js';
796796

src/content/learn/lifecycle-of-reactive-effects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ If you see a linter rule being suppressed, remove the suppression! That's where
11311131
11321132
<Sandpack>
11331133
1134-
```js {expectedErrors: {'react-compiler': [16]}}
1134+
```js
11351135
import { useState, useEffect } from 'react';
11361136

11371137
export default function App() {
@@ -1374,7 +1374,7 @@ export default function App() {
13741374
}
13751375
```
13761376
1377-
```js {expectedErrors: {'react-compiler': [8]}} src/ChatRoom.js active
1377+
```js src/ChatRoom.js active
13781378
import { useState, useEffect } from 'react';
13791379

13801380
export default function ChatRoom({ roomId, createConnection }) {

src/content/learn/preserving-and-resetting-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ Here, the `MyTextField` component function is defined *inside* `MyComponent`:
704704

705705
<Sandpack>
706706

707-
```js {expectedErrors: {'react-compiler': [7]}}
707+
```js
708708
import { useState } from 'react';
709709

710710
export default function MyComponent() {

src/content/learn/react-compiler/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ React Compiler automatically optimizes your React application at build time. Rea
2828

2929
Without the compiler, you need to manually memoize components and values to optimize re-renders:
3030

31-
```js {expectedErrors: {'react-compiler': [4]}}
31+
```js
3232
import { useMemo, useCallback, memo } from 'react';
3333

3434
const ExpensiveComponent = memo(function ExpensiveComponent({ data, onClick }) {

src/content/learn/referencing-values-with-refs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export default function Counter() {
211211

212212
<Sandpack>
213213

214-
```js {expectedErrors: {'react-compiler': [13]}}
214+
```js
215215
import { useRef } from 'react';
216216

217217
export default function Counter() {
@@ -313,7 +313,7 @@ console.log(ref.current); // 5
313313

314314
<Sandpack>
315315

316-
```js {expectedErrors: {'react-compiler': [10]}}
316+
```js
317317
import { useState } from 'react';
318318

319319
export default function Chat() {
@@ -418,7 +418,7 @@ export default function Chat() {
418418

419419
<Sandpack>
420420

421-
```js {expectedErrors: {'react-compiler': [10]}}
421+
```js
422422
import { useRef } from 'react';
423423

424424
export default function Toggle() {

src/content/learn/removing-effect-dependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Suppressing the linter leads to very unintuitive bugs that are hard to find and
303303
304304
<Sandpack>
305305
306-
```js {expectedErrors: {'react-compiler': [14]}}
306+
```js
307307
import { useState, useEffect } from 'react';
308308

309309
export default function Timer() {
@@ -794,7 +794,7 @@ It is important to declare it as a dependency! This ensures, for example, that i
794794
795795
<Sandpack>
796796
797-
```js {expectedErrors: {'react-compiler': [10]}}
797+
```js
798798
import { useState, useEffect } from 'react';
799799
import { createConnection } from './chat.js';
800800

src/content/learn/responding-to-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ Clicking this button is supposed to switch the page background between white and
546546
547547
<Sandpack>
548548
549-
```js {expectedErrors: {'react-compiler': [5, 7]}}
549+
```js
550550
export default function LightSwitch() {
551551
function handleClick() {
552552
let bodyStyle = document.body.style;

src/content/learn/separating-events-from-effects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ Here, `url` inside `onVisit` corresponds to the *latest* `url` (which could have
711711
712712
In the existing codebases, you may sometimes see the lint rule suppressed like this:
713713
714-
```js {expectedErrors: {'react-compiler': [8]}} {7-9}
714+
```js {7-9}
715715
function Page({ url }) {
716716
const { items } = useContext(ShoppingCartContext);
717717
const numberOfItems = items.length;
@@ -735,7 +735,7 @@ Can you see why?
735735
736736
<Sandpack>
737737
738-
```js {expectedErrors: {'react-compiler': [16]}}
738+
```js
739739
import { useState, useEffect } from 'react';
740740

741741
export default function App() {
@@ -990,7 +990,7 @@ To fix this code, it's enough to follow the rules.
990990
```
991991
992992
993-
```js {expectedErrors: {'react-compiler': [14]}}
993+
```js
994994
import { useState, useEffect } from 'react';
995995

996996
export default function Timer() {

0 commit comments

Comments
 (0)