From: Jérôme Benoit Date: Thu, 10 Aug 2023 17:44:57 +0000 (+0200) Subject: build: fix linter configuraion for TS examples X-Git-Tag: v2.6.23~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=95e506515709f64317b47a96b37ab5853c73e356;p=poolifier.git build: fix linter configuraion for TS examples Signed-off-by: Jérôme Benoit --- diff --git a/.eslintrc.js b/.eslintrc.js index 02782ad4..a6b0c95a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -115,9 +115,12 @@ module.exports = defineConfig({ { files: ['examples/typescript/**/*.ts'], rules: { - // '@typescript-eslint/no-unsafe-argument': 'off', + 'import/no-unresolved': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off' + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off' } }, { diff --git a/examples/typescript/http-client/package.json b/examples/typescript/http-client/package.json index a1627747..04beb8be 100644 --- a/examples/typescript/http-client/package.json +++ b/examples/typescript/http-client/package.json @@ -20,6 +20,7 @@ "author": "", "license": "ISC", "dependencies": { + "axios": "^1.4.0", "node-fetch": "^3.3.2", "poolifier": "^2.6.22" }, diff --git a/examples/typescript/http-client/pnpm-lock.yaml b/examples/typescript/http-client/pnpm-lock.yaml index 80df5f9c..270c6202 100644 --- a/examples/typescript/http-client/pnpm-lock.yaml +++ b/examples/typescript/http-client/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + axios: + specifier: ^1.4.0 + version: 1.4.0 node-fetch: specifier: ^3.3.2 version: 3.3.2 @@ -26,11 +29,37 @@ packages: resolution: {integrity: sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==} dev: true + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axios@1.4.0: + resolution: {integrity: sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + /data-uri-to-buffer@4.0.1: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} dev: false + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + /fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} @@ -39,6 +68,25 @@ packages: web-streams-polyfill: 3.2.1 dev: false + /follow-redirects@1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + /formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -46,6 +94,18 @@ packages: fetch-blob: 3.2.0 dev: false + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + /node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -66,6 +126,10 @@ packages: requiresBuild: true dev: false + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} diff --git a/examples/typescript/http-client/src/worker.ts b/examples/typescript/http-client/src/worker.ts index f05c8d1e..b12466d2 100644 --- a/examples/typescript/http-client/src/worker.ts +++ b/examples/typescript/http-client/src/worker.ts @@ -6,7 +6,7 @@ import { } from 'node-fetch' import { type WorkerData, type WorkerResponse } from './types.js' -class FetchWorker extends ThreadWorker { +class HttpClientWorker extends ThreadWorker { public constructor () { super({ node_fetch: async (workerData?: WorkerData) => { @@ -33,6 +33,6 @@ class FetchWorker extends ThreadWorker { } } -const fetchWorker = new FetchWorker() +const httpClientWorker = new HttpClientWorker() -export { fetchWorker } +export { httpClientWorker }