Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
概要
ESLintとその設定を追加した。
追加で以下のプラグインも追加している。
window.Stimulus
というコードがno-undefルール('window' is not defined
)に引っかかってしまう。備考
ESLintの設定ファイル
ESLintはバージョン9から新しい設定方法(flat config)を使うようになっている。
新しい設定方法では、設定ファイルとして
.eslint.config.js
を利用するようになった(それ以前は.eslintrc.js
)。バージョン8.23.0以降でも
.eslint.config.js
が利用できるようになっているため、今回は新しい設定方法を利用することにする。https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#configuration-new-eslintconfigjs
eslint-plugin-react-hooksの設定
どうやら、eslint-plugin-react-hooksはflat configに対応していない模様(2024/09/28時点)。
facebook/react#28313
そこで、以下の記事を参考に設定を行った。