Jelajahi Sumber

ref: switch to esnext import syntax

Sven 9 bulan lalu
induk
melakukan
6c765fef9b
7 mengubah file dengan 18 tambahan dan 18 penghapusan
  1. 1 1
      lib/DataStoreSerializer.ts
  2. 1 1
      lib/SelectorObserver.ts
  3. 1 1
      lib/array.ts
  4. 9 9
      lib/index.ts
  5. 2 2
      lib/misc.ts
  6. 2 2
      lib/translation.ts
  7. 2 2
      tsconfig.json

+ 1 - 1
lib/DataStoreSerializer.ts

@@ -1,4 +1,4 @@
-import { getUnsafeWindow, type DataStore } from ".";
+import { getUnsafeWindow, type DataStore } from "./index.js";
 
 export type DataStoreSerializerOptions = {
   /** Whether to add a checksum to the exported data */

+ 1 - 1
lib/SelectorObserver.ts

@@ -1,4 +1,4 @@
-import { debounce } from "./misc";
+import { debounce } from "./misc.js";
 
 /** Options for the `onSelector()` method of {@linkcode SelectorObserver} */
 export type SelectorListenerOptions<TElem extends Element = HTMLElement> = SelectorOptionsOne<TElem> | SelectorOptionsAll<TElem>;

+ 1 - 1
lib/array.ts

@@ -1,4 +1,4 @@
-import { randRange } from "./math";
+import { randRange } from "./math.js";
 
 /** Describes an array with at least one item */
 export type NonEmptyArray<TArray = unknown> = [TArray, ...TArray[]];

+ 9 - 9
lib/index.ts

@@ -1,9 +1,9 @@
-export * from "./array";
-export * from "./DataStore";
-export * from "./DataStoreSerializer";
-export * from "./dom";
-export * from "./math";
-export * from "./misc";
-export * from "./SelectorObserver";
-export * from "./translation";
-export * from "./types";
+export * from "./array.js";
+export * from "./DataStore.js";
+export * from "./DataStoreSerializer.js";
+export * from "./dom.js";
+export * from "./math.js";
+export * from "./misc.js";
+export * from "./SelectorObserver.js";
+export * from "./translation.js";
+export * from "./types.js";

+ 2 - 2
lib/misc.ts

@@ -1,5 +1,5 @@
-import { getUnsafeWindow } from "./dom";
-import type { Stringifiable } from "./types";
+import { getUnsafeWindow } from "./dom.js";
+import type { Stringifiable } from "./types.js";
 
 /**
  * Automatically appends an `s` to the passed {@linkcode word}, if {@linkcode num} is not equal to 1

+ 2 - 2
lib/translation.ts

@@ -1,5 +1,5 @@
-import { insertValues } from "./misc";
-import type { Stringifiable } from "./types";
+import { insertValues } from "./misc.js";
+import type { Stringifiable } from "./types.js";
 
 /** Trans rights! 🏳️‍⚧️ */
 const trans: Record<string, Record<string, string>> = {};

+ 2 - 2
tsconfig.json

@@ -1,7 +1,7 @@
 {
   "compilerOptions": {
-    "module": "ESNext",
-    "moduleResolution": "node",
+    "module": "NodeNext",
+    "moduleResolution": "NodeNext",
     "target": "ES2016",
     "outDir": "dist/out",
     "lib": ["ES2020", "DOM", "DOM.Iterable"],