Skip to content

Commit f47d0e9

Browse files
committed
Translate unsupported-syntax lint rule
1 parent 37a7f80 commit f47d0e9

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎src/content/reference/eslint-plugin-react-hooks/lints/unsupported-syntax.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ title: unsupported-syntax
44

55
<Intro>
66

7-
Validates against syntax that React Compiler does not support. If you need to, you can still use this syntax outside of React, such as in a standalone utility function.
7+
React Compiler がサポートしていない構文を使っていないか検証します。その構文が必要な場合、独立したユーティリティ関数など、React の外であれば引き続き使用できます。
88

99
</Intro>
1010

11-
## Rule Details {/*rule-details*/}
11+
## ルールの詳細 {/*rule-details*/}
1212

13-
React Compiler needs to statically analyze your code to apply optimizations. Features like `eval` and `with` make it impossible to statically understand what the code does at compile time, so the compiler can't optimize components that use them.
13+
React Compiler が最適化を適用するには、コードを静的に解析する必要があります。`eval` や `with` などの機能を使うと、コードの動作をコンパイル時に静的に理解できなくなるため、コンパイラはそれらを使うコンポーネントを最適化できません。
1414

15-
### Invalid {/*invalid*/}
15+
### 無効な例 {/*invalid*/}
1616

17-
Examples of incorrect code for this rule:
17+
このルールに違反するコードの例です。
1818

1919
```js
2020
// ❌ Using eval in component
@@ -37,9 +37,9 @@ function Component({propName}) {
3737
}
3838
```
3939

40-
### Valid {/*valid*/}
40+
### 有効な例 {/*valid*/}
4141

42-
Examples of correct code for this rule:
42+
このルールに従ったコードの例です。
4343

4444
```js
4545
// ✅ Use normal property access
@@ -54,11 +54,11 @@ function Component() {
5454
}
5555
```
5656

57-
## Troubleshooting {/*troubleshooting*/}
57+
## トラブルシューティング {/*troubleshooting*/}
5858

59-
### I need to evaluate dynamic code {/*evaluate-dynamic-code*/}
59+
### 動的なコードを評価したい {/*evaluate-dynamic-code*/}
6060

61-
You might need to evaluate user-provided code:
61+
以下のように、ユーザが入力したコードを評価する必要があるかもしれません。
6262

6363
```js {expectedErrors: {'react-compiler': [3]}}
6464
// ❌ Wrong: eval in component
@@ -68,7 +68,7 @@ function Calculator({expression}) {
6868
}
6969
```
7070

71-
Use a safe expression parser instead:
71+
代わりに、安全な式のパーサを使ってください。
7272

7373
```js
7474
// ✅ Better: Use a safe parser
@@ -97,6 +97,6 @@ function Calculator({expression}) {
9797

9898
<Note>
9999

100-
Never use `eval` with user input - it's a security risk. Use dedicated parsing libraries for specific use cases like mathematical expressions, JSON parsing, or template evaluation.
100+
ユーザの入力に対して `eval` を決して使ってはいけません。セキュリティ上のリスクがあります。数式や JSON のパース、テンプレートの評価といった用途に応じて、専用のパース用ライブラリを使ってください。
101101

102102
</Note>

0 commit comments

Comments
 (0)