From 4f043f71493d44a5a08b35054711383ada093f8a Mon Sep 17 00:00:00 2001 From: Philipp Giese <187786+frontendphil@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:56:45 +0100 Subject: [PATCH] chore: activate linting for vnet and fork api (#507) * add linting to fork api, fix issues * add linting to vnet api, fix issues --- deployables/fork-api/eslint.config.mjs | 3 +++ deployables/fork-api/package.json | 5 ++++- deployables/fork-api/src/index.ts | 6 +----- deployables/vnet-api/eslint.config.mjs | 3 +++ deployables/vnet-api/package.json | 5 ++++- deployables/vnet-api/src/index.ts | 6 +----- pnpm-lock.yaml | 12 ++++++++++++ 7 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 deployables/fork-api/eslint.config.mjs create mode 100644 deployables/vnet-api/eslint.config.mjs diff --git a/deployables/fork-api/eslint.config.mjs b/deployables/fork-api/eslint.config.mjs new file mode 100644 index 00000000..d2778d4f --- /dev/null +++ b/deployables/fork-api/eslint.config.mjs @@ -0,0 +1,3 @@ +import zodiacEslintConfig from '@zodiac/eslint-config' + +export default zodiacEslintConfig diff --git a/deployables/fork-api/package.json b/deployables/fork-api/package.json index 8427de77..e9d658cf 100644 --- a/deployables/fork-api/package.json +++ b/deployables/fork-api/package.json @@ -3,8 +3,10 @@ "version": "1.0.0", "devDependencies": { "@cloudflare/workers-types": "^4.0.0", + "@zodiac/eslint-config": "workspace:*", "@zodiac/typescript-config": "workspace:*", "env-cmd": "^10.1.0", + "eslint": "^9.7.0", "typescript": "^5.0.0", "wrangler": "3.101.0" }, @@ -12,7 +14,8 @@ "scripts": { "start": "env-cmd wrangler dev", "deploy": "wrangler publish", - "check-types": "tsc --noEmit" + "check-types": "tsc --noEmit", + "lint": "eslint . --max-warnings=0" }, "packageManager": "pnpm@9.15.3" } diff --git a/deployables/fork-api/src/index.ts b/deployables/fork-api/src/index.ts index e738d8c7..94b46ace 100644 --- a/deployables/fork-api/src/index.ts +++ b/deployables/fork-api/src/index.ts @@ -1,11 +1,7 @@ import type { Env } from './types' export default { - async fetch( - request: Request, - env: Env, - ctx: ExecutionContext, - ): Promise { + async fetch(request: Request, env: Env): Promise { const { pathname } = new URL(request.url) const tenderlyForkApi = `https://api.tenderly.co/api/v1/account/${env.TENDERLY_USER}/project/${env.TENDERLY_PROJECT}/fork` diff --git a/deployables/vnet-api/eslint.config.mjs b/deployables/vnet-api/eslint.config.mjs new file mode 100644 index 00000000..d2778d4f --- /dev/null +++ b/deployables/vnet-api/eslint.config.mjs @@ -0,0 +1,3 @@ +import zodiacEslintConfig from '@zodiac/eslint-config' + +export default zodiacEslintConfig diff --git a/deployables/vnet-api/package.json b/deployables/vnet-api/package.json index 0b0533a0..6b6ce544 100644 --- a/deployables/vnet-api/package.json +++ b/deployables/vnet-api/package.json @@ -3,8 +3,10 @@ "version": "1.0.0", "devDependencies": { "@cloudflare/workers-types": "^4.0.0", + "@zodiac/eslint-config": "workspace:*", "@zodiac/typescript-config": "workspace:*", "env-cmd": "^10.1.0", + "eslint": "^9.7.0", "typescript": "^5.0.0", "wrangler": "3.101.0" }, @@ -12,7 +14,8 @@ "scripts": { "start": "env-cmd wrangler dev", "deploy": "wrangler publish", - "check-types": "tsc --noEmit" + "check-types": "tsc --noEmit", + "lint": "eslint . --max-warnings=0" }, "packageManager": "pnpm@9.15.3" } diff --git a/deployables/vnet-api/src/index.ts b/deployables/vnet-api/src/index.ts index 39893cff..b62a43a3 100644 --- a/deployables/vnet-api/src/index.ts +++ b/deployables/vnet-api/src/index.ts @@ -1,11 +1,7 @@ import type { Env } from './types' export default { - async fetch( - request: Request, - env: Env, - ctx: ExecutionContext, - ): Promise { + async fetch(request: Request, env: Env): Promise { const { pathname } = new URL(request.url) const tenderlyForkApi = `https://api.tenderly.co/api/v1/account/${env.TENDERLY_USER}/project/${env.TENDERLY_PROJECT}/vnets` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 570d4bfc..dfe1daa0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -484,12 +484,18 @@ importers: '@cloudflare/workers-types': specifier: ^4.0.0 version: 4.20250109.0 + '@zodiac/eslint-config': + specifier: workspace:* + version: link:../../configs/eslint '@zodiac/typescript-config': specifier: workspace:* version: link:../../configs/typescript env-cmd: specifier: ^10.1.0 version: 10.1.0 + eslint: + specifier: ^9.7.0 + version: 9.17.0(jiti@2.4.1) typescript: specifier: ^5.0.0 version: 5.7.3 @@ -563,12 +569,18 @@ importers: '@cloudflare/workers-types': specifier: ^4.0.0 version: 4.20250109.0 + '@zodiac/eslint-config': + specifier: workspace:* + version: link:../../configs/eslint '@zodiac/typescript-config': specifier: workspace:* version: link:../../configs/typescript env-cmd: specifier: ^10.1.0 version: 10.1.0 + eslint: + specifier: ^9.7.0 + version: 9.17.0(jiti@2.4.1) typescript: specifier: ^5.0.0 version: 5.7.3