diff --git a/package.json b/package.json index 1cd9b66..a89cb4b 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "test:coverage": "tap", "lint": "eslint .", "lint:fix": "eslint . --fix", - "types": "run-s types:tsc types:fixup", + "types": "run-s types:tsc types:fixup types:test", "types:tsc": "tsc", "types:test": "tsc --project tsconfig.test.json", "types:fixup": "node ./fixup.js" @@ -49,6 +49,7 @@ "@podium/eslint-config": "1.0.0", "@podium/podlet": "5.1.17", "@podium/test-utils": "2.5.2", + "@podium/typescript-config": "1.0.0", "@semantic-release/changelog": "6.0.3", "@semantic-release/git": "10.0.1", "eslint": "9.9.1", diff --git a/test/podlet-plugin.js b/test/podlet-plugin.js index c1c1ef3..4140c5e 100644 --- a/test/podlet-plugin.js +++ b/test/podlet-plugin.js @@ -27,16 +27,22 @@ class Server { this.app.register(fastifyForm); // Needed to handle non GET requests this.app.get(podlet.content(), async (req, reply) => { + // @ts-ignore if (reply.app.podium.context.locale === 'nb-NO') { + // @ts-ignore return reply.podiumSend('nb-NO'); } + // @ts-ignore if (reply.app.podium.context.locale === 'en-NZ') { + // @ts-ignore return reply.podiumSend('en-NZ'); } + // @ts-ignore return reply.podiumSend('en-US'); }); this.app.get(podlet.fallback(), async (req, reply) => { + // @ts-ignore return reply.podiumSend('fallback'); }); @@ -67,6 +73,7 @@ class Server { .listen({ port: 0, host: '127.0.0.1' }) .then(() => { const address = this.app.server.address(); + // @ts-ignore const url = `http://${address.address}:${address.port}`; resolve(url); }) diff --git a/tsconfig.json b/tsconfig.json index 076be6a..19707f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,7 @@ { - "compilerOptions": { - "lib": ["es2020"], - "module": "nodenext", - "target": "es2020", - "resolveJsonModule": true, - "checkJs": true, - "allowJs": true, - "moduleResolution": "nodenext", - "emitDeclarationOnly": true, - "declaration": true, - "allowSyntheticDefaultImports": true, - "outDir": "types" - }, - "include": ["./lib/**/*.js"] + "extends": "@podium/typescript-config/module.json", + "include": ["./lib/**/*.js"], + "compilerOptions": { + "outDir": "types" + } } diff --git a/tsconfig.test.json b/tsconfig.test.json index 530ad59..f3a32c4 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -1,9 +1,4 @@ { - "extends": "./tsconfig.json", - "include": ["./tests/**/*.js"], - "compilerOptions": { - "module": "nodenext", - "moduleResolution": "nodenext", - "noEmit": true - } + "extends": "@podium/typescript-config/test.json", + "include": ["./test/**/*.js"] }