以下の内容はhttps://tech.motoki-watanabe.net/entry/2020/09/23/011526より取得しました。


ESLintの標準だとTypeScriptで型定義にもno-unused-varsのエラーが出てしまうのを直す

.eslintrc.jsonに書いてある設定の

"extends": ["eslint:recommended"],

で、

onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void

に対して

'event' is defined but never used

とエラーが出ていました。


TypeScriptで型定義でno-unuse-varsのエラーが出ないように、ESLintデフォルトのno-unused-varsを無効化し、TypeScript用のno-unused-varsを追加する必要があるそうです。

github.com

.eslintrc.jsonのrulesに

"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"]

を追記する。これでTypeScriptに対応したno-unused-varsになってくれる。




以上の内容はhttps://tech.motoki-watanabe.net/entry/2020/09/23/011526より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14