Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: TypeScript doesn't like black magic

Elijah Potter4b9aafcdcf0d
diff --git a/packages/.eslintrc.cjs b/packages/.eslintrc.cjs
index 903a39b75..75fb97303 100644
--- a/packages/.eslintrc.cjs
+++ b/packages/.eslintrc.cjs
@@ -9,7 +9,8 @@ module.exports = {
rules: {
'prettier/prettier': 'error',
// Just annoying
- '@typescript-eslint/no-explicit-any': ['off']
+ '@typescript-eslint/no-explicit-any': ['off'],
+ '@typescript-eslint/ban-ts-comment': ['off']
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
diff --git a/packages/harper.js/src/loadWasm.ts b/packages/harper.js/src/loadWasm.ts
index fbca1481e..a6bfe56e3 100644
--- a/packages/harper.js/src/loadWasm.ts
+++ b/packages/harper.js/src/loadWasm.ts
@@ -1,9 +1,10 @@
-// @ts-ignore
+// @ts-expect-error because this virtual module hasn't been added to a `d.ts` file.
import wasmUri from 'virtual:wasm';
let curWasmUri = wasmUri;
-/** Get the currently set data URI for the WebAssembly module. */
+/** Get the currently set data URI for the WebAssembly module.
+ * I'm not a huge of the singleton, but we're swapping out same data, just from a different source, so the state doesn't meaningfully change. */
export function getWasmUri(): string {
return curWasmUri;
}
@@ -18,6 +19,7 @@ export function setWasmUri(uri: string) {
* */
export default async function loadWasm() {
const wasm = await import('wasm');
+ // @ts-ignore
await wasm.default(getWasmUri());
return wasm;