Checked Import Attributes and Assertions

TL;DR

import X from Y with { type: Z } のタイプがチェックされるようになった。

import * as ns from "foo" with { type: "not-json" }; // ERROR

type の文字列は ImportAttributes で宣言される。

interface ImportAttributes {
  type "json";
}

Last updated