https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#37-breaking-changes [[TypeScript 3.7]]で破壊的的変更を伴うものをいくつか紹介。 ### DOM Changes [[lib.dom.d.ts]]が望ましい方向にアップデートされた。一部影響がある。 ### Class Field Mitigations [[【TypeScript 3.7】The useDefineForClassFields Flag and The declare Property Modifier#破壊的変更による影響点]]を参照。 ### Function Truthy Checks [[【TypeScript 3.7】Uncalled Function Checks#エラーにならないケース]]を参照。 ### Local and Imported Type Declarations Now Conflict 同一ファイル内とimportで同名の宣言が存在する場合、競合エラーが出るようになった。以前は`import`した宣言が優先されていた。 以下は一例。 `someOtherModule.ts` ```ts export interface SomeType { y: string; } ``` `main.ts` ```ts // TypeScript3.7では Import declaration conflicts with local declaration of 'SomeType' エラーになるが3.6ではならない.. import { SomeType } from "./someOtherModule"; export interface SomeType { x: number; } function fn(arg: SomeType) { // どちらも'x' doesn't exist on 'SomeType' エラーになる console.log(arg.x); } ```