From ae7671e8995d468444854db2f3a512051a070510 Mon Sep 17 00:00:00 2001 From: -akku- Date: Thu, 12 Dec 2024 23:48:48 +0900 Subject: [PATCH] Fix --- package.json | 1 + src/global-patches.ts | 3 +-- tsconfig.json | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tsconfig.json diff --git a/package.json b/package.json index 08f3b14dbf..064f4dbc2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "scratch-blocks", "version": "1.1.206", + "type": "module", "description": "Scratch Blocks is a library for building creative computing interfaces.", "author": "Massachusetts Institute of Technology", "license": "Apache-2.0", diff --git a/src/global-patches.ts b/src/global-patches.ts index 37ff404a9c..cd5aa1321a 100644 --- a/src/global-patches.ts +++ b/src/global-patches.ts @@ -70,8 +70,7 @@ export const goog = { elem.className = attrs.join(' ') } else { for (const key in attrs) { - // @ts-ignore - elem[key] = attrs[key] + elem.setAttribute(key, attrs[key]) } } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..a0fca2e07d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "lib": ["ESNext", "WebWorker", "DOM"], + "rootDir": "./src", + "strict": true, + "noEmit": true, + "checkJs": true, + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + }, + "include": ["src/**/*"], + "exclude": ["node_modules"], + "compileOnSave": false +}