.jsをつけて回る
from tsなのに、.jsという拡張子でimportする必要がある
という面倒な作業をしないといけない
eslint-cjs-to-esm
@azuさんの
https://github.com/azu/eslint-cjs-to-esm
https://efcl.info/2023/01/18/eslint-cjs-to-esm/
$ npx eslint-cjs-to-esm "./src/**/*.{tsx,ts}" --fix
VSCodeで置換
(from '@/.*)(';)→$1.js$2
Subpath Importsしてる箇所があったので
9000箇所ぐらいエラーになった
next/link, next/image, next/dynamicなどが、末尾に.jsをつけないと型エラーになる
.defaultを付けないと動かないのなに?