Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bug: [email protected] only detects english component names

オープン 初心者向け
#31,446 コメント 15 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
javascript, react
領域
frontend, tooling

調査の方向性

issue でリンクされている isComponentName メソッドの周辺にある packages/eslint-plugin-react-hooks/src/RulesOfHooks.js から始め、ÄndraVärde のようなコンポーネントを使って lint エラーを再現します。英語以外の大文字が受け入れられるようにコンポーネント名のチェックを更新し、再現した hook の警告が発生しなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

Status: Unconfirmed

React version: [email protected]

Steps To Reproduce

  1. Create a functional component with a name such as ÄndraVärde that starts with a non english upper case letter
  2. Run the linter

The current behavior

Sample error:

23:20 error React Hook "useSelectedState" is called in function "ÄndraVärde" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use" react-hooks/rules-of-hooks

The expected behavior

The linting should allow non english component names, React does.

The problem

Version 5.0.0 included the changes made in #25162 which modified the following method:
https://github.com/facebook/react/blob/e1378902bbb322aa1fe1953780f4b2b5f80d26b1/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js#L43-L50

This code only allows english upper case letters A-Z which is not enough.

Proposed solution

Use .toUpperCase() and compare the result:

function isComponentName(node) { 
  return node.type === 'Identifier' && node.name[0] == node.name[0].toUpperCase(); 
} 

This should work with a lot more languages at least.

主要言語
JavaScript
スター
251k
フォーク
51.4k
平均マージ
1日 17時間
マージ済み PR(30日)
43

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

react/react のほかの issue

react/react の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。