0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Next.js での Biome 設定メモ

Posted at

Biome では Error 定義がエラーになる

error.js (Next.js) の記載の通りに実装すると、Error 定義が Biome でエラー表示されます。

biome_jsonc.png

ESLint にも同じルールが存在し、Next.js は ESLint を利用して開発されています。
問題になっていないのは、ESLint の定義が甘いための様です。

refs:

解決策の候補

  1. Biome の設定を調整
  2. ErrorPage に変更

1. Biome の設定を変更

指定としては Biome の方がベターな印象なので、特定ファイルに絞って対象ルールを解除します。

biome.jsonc
{
    ...

	"overrides": [
		{
			"include": ["app/**/error.tsx"],
			"linter": {
				"rules": { "suspicious": { "noShadowRestrictedNames": "off" } }
			}
		}
	]
}

以下に突貫の解決策としてコメントされていましたので参考までに。

2. ErrorPage に変更

手っ取り早さを求めるでしたら簡単に、
ErrorErrorPage に変更するだけで解消できます。

考察

主観ではなるべくドキュメントに沿った実装を心がけたいため、Biome の調整がお勧めでしょうか🧐
将来的に Next.js やドキュメントでも Error を、使用しない方向にハンドリングされる可能性は有りますが。

Biome は ESLint に比べてパッケージの管理が楽なので、積極的に採用したい所です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?