ビルド時
TS2564: Property '...' has no initializer and is not definitely assigned in the constructor.
tsconfig.jsonのstrictPropertyInitializationをfalseにするか、対象ファイルのプロパティ型宣言部分をfoo!: stringのように!を付ける。
TS2339: Property 'includes' does not exist on type '...'
tsconfig.jsonのlibにes7を含める。
TS2339: Property 'entries' does not exist on type '...'
tsconfig.jsonのlibにesnextを含める。
import {...} from 'microrouter'; SyntaxError: Unexpected token {
commonjsでの実行が必要な部分にesnextを使っている可能性があります。compilerOptions.moduleがcommonjsになってないならそれかもしれません。
'this' implicitly has type 'any' because it does not have a type annotation.
functionのthisの型を指定してあげる。
function foo(this: Foo) {
/*...*/
}Duplicate identifier '...'
tsconfig.jsonのcompilerOptions.typesを使っているパッケージだけにする。
直接使っている型なら、node_modulesの削除とyarn cache clean、またモノレポであればその型パッケージバージョンをすべてのワークスペースで統一するなど。
jest
Cannot find name 'test'. Do you need to install type definitions for a test runner? Try npm i @types/jest or npm i @types/mocha and then add jest or mocha to the types field in your tsconfig.ts(2593)
compilerOptions.typeRootsやcompilerOptions.typesが変なことになっていないか確認する。上のDuplicate identifier '...'の対応でjestを含めていないなど。
