From 47efa784c0b24d52cfcb5fa2147ca8c71026efe3 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 22 Jul 2024 09:57:10 +0200 Subject: [PATCH] chore: repo maintenance 2024-07-22 (#1122) --- .nvmrc | 2 +- package.json | 4 +- packages/api/src/trpc.ts | 47 ++++-- pnpm-lock.yaml | 297 ++++++++++++++++++------------------ pnpm-workspace.yaml | 4 +- tooling/eslint/base.js | 9 +- tooling/eslint/package.json | 3 +- 7 files changed, 195 insertions(+), 171 deletions(-) diff --git a/.nvmrc b/.nvmrc index d5908b994..24f544994 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.12 \ No newline at end of file +20.15 \ No newline at end of file diff --git a/package.json b/package.json index 09c81ae68..21e1b28bc 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,9 @@ "name": "create-t3-turbo", "private": true, "engines": { - "node": ">=20.12.0" + "node": ">=20.15.0" }, - "packageManager": "pnpm@9.5.0", + "packageManager": "pnpm@9.6.0", "scripts": { "build": "turbo run build", "clean": "git clean -xdf node_modules", diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts index 9d85d4460..cc596fcc4 100644 --- a/packages/api/src/trpc.ts +++ b/packages/api/src/trpc.ts @@ -90,6 +90,29 @@ export const createCallerFactory = t.createCallerFactory; */ export const createTRPCRouter = t.router; +/** + * Middleware for timing procedure execution and adding an articifial delay in development. + * + * You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating + * network latency that would occur in production but not in local development. + */ +const timingMiddleware = t.middleware(async ({ next, path }) => { + const start = Date.now(); + + if (t._config.isDev) { + // artificial delay in dev 100-500ms + const waitMs = Math.floor(Math.random() * 400) + 100; + await new Promise((resolve) => setTimeout(resolve, waitMs)); + } + + const result = await next(); + + const end = Date.now(); + console.log(`[TRPC] ${path} took ${end - start}ms to execute`); + + return result; +}); + /** * Public (unauthed) procedure * @@ -97,7 +120,7 @@ export const createTRPCRouter = t.router; * tRPC API. It does not guarantee that a user querying is authorized, but you * can still access user session data if they are logged in */ -export const publicProcedure = t.procedure; +export const publicProcedure = t.procedure.use(timingMiddleware); /** * Protected (authenticated) procedure @@ -107,14 +130,16 @@ export const publicProcedure = t.procedure; * * @see https://trpc.io/docs/procedures */ -export const protectedProcedure = t.procedure.use(({ ctx, next }) => { - if (!ctx.session?.user) { - throw new TRPCError({ code: "UNAUTHORIZED" }); - } - return next({ - ctx: { - // infers the `session` as non-nullable - session: { ...ctx.session, user: ctx.session.user }, - }, +export const protectedProcedure = t.procedure + .use(timingMiddleware) + .use(({ ctx, next }) => { + if (!ctx.session?.user) { + throw new TRPCError({ code: "UNAUTHORIZED" }); + } + return next({ + ctx: { + // infers the `session` as non-nullable + session: { ...ctx.session, user: ctx.session.user }, + }, + }); }); -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e117e0a22..dabb95c89 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,11 +19,11 @@ catalogs: specifier: ^11.0.0-rc.466 version: 11.0.0-rc.466 eslint: - specifier: ^9.6.0 - version: 9.6.0 + specifier: ^9.7.0 + version: 9.7.0 prettier: - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^3.3.3 + version: 3.3.3 typescript: specifier: ^5.5.3 version: 5.5.3 @@ -56,7 +56,7 @@ importers: version: 2.0.8(@types/node@20.14.9)(typescript@5.5.3) prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 turbo: specifier: ^2.0.8 version: 2.0.8 @@ -87,7 +87,7 @@ importers: version: 20.14.9 eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 h3: specifier: ^1.12.0 version: 1.12.0 @@ -96,7 +96,7 @@ importers: version: 2.9.7(@opentelemetry/api@1.9.0)(@planetscale/database@1.18.0) prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -214,10 +214,10 @@ importers: version: 18.3.3 eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 tailwindcss: specifier: ^3.4.4 version: 3.4.4(ts-node@10.9.2(@types/node@20.14.9)(typescript@5.5.3)) @@ -302,13 +302,13 @@ importers: version: 7.4.2 eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 jiti: specifier: ^1.21.6 version: 1.21.6 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 tailwindcss: specifier: ^3.4.4 version: 3.4.4(ts-node@10.9.2(@types/node@20.14.9)(typescript@5.5.3)) @@ -348,10 +348,10 @@ importers: version: link:../../tooling/typescript eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -397,10 +397,10 @@ importers: version: link:../../tooling/typescript eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -440,10 +440,10 @@ importers: version: 0.22.8 eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -501,10 +501,10 @@ importers: version: 18.3.3 eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 react: specifier: catalog:react18 version: 18.3.1 @@ -535,37 +535,40 @@ importers: version: link:../../tooling/typescript eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 tooling/eslint: dependencies: + '@eslint/compat': + specifier: ^1.1.1 + version: 1.1.1 '@next/eslint-plugin-next': specifier: ^14.2.4 version: 14.2.4 eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0) + version: 2.29.1(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0) eslint-plugin-jsx-a11y: specifier: ^6.9.0 - version: 6.9.0(eslint@9.6.0) + version: 6.9.0(eslint@9.7.0) eslint-plugin-react: - specifier: ^7.34.3 - version: 7.34.3(eslint@9.6.0) + specifier: ^7.35.0 + version: 7.35.0(eslint@9.7.0) eslint-plugin-react-hooks: specifier: rc - version: 5.1.0-rc-512b09b2-20240718(eslint@9.6.0) + version: 5.1.0-rc-512b09b2-20240718(eslint@9.7.0) eslint-plugin-turbo: specifier: ^2.0.8 - version: 2.0.8(eslint@9.6.0) + version: 2.0.8(eslint@9.7.0) typescript-eslint: specifier: rc-v8 - version: 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) + version: 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) devDependencies: '@acme/prettier-config': specifier: workspace:* @@ -575,10 +578,10 @@ importers: version: link:../typescript eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -589,13 +592,13 @@ importers: dependencies: '@ianvs/prettier-plugin-sort-imports': specifier: ^4.3.0 - version: 4.3.0(prettier@3.3.2) + version: 4.3.0(prettier@3.3.3) prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 prettier-plugin-tailwindcss: specifier: ^0.6.5 - version: 0.6.5(@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.2))(prettier@3.3.2) + version: 0.6.5(@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.3))(prettier@3.3.3) devDependencies: '@acme/tsconfig': specifier: workspace:* @@ -627,10 +630,10 @@ importers: version: link:../typescript eslint: specifier: 'catalog:' - version: 9.6.0 + version: 9.7.0 prettier: specifier: 'catalog:' - version: 3.3.2 + version: 3.3.3 typescript: specifier: 'catalog:' version: 5.5.3 @@ -1881,6 +1884,10 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint/compat@1.1.1': + resolution: {integrity: sha512-lpHyRyplhGPL5mGEh6M9O5nnKk0Gz4bFI+Zu6tKlPpDUN7XshWvH9C/px4UVm87IAANE0W81CEsNGbS1KlzXpA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.17.0': resolution: {integrity: sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1889,8 +1896,8 @@ packages: resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.6.0': - resolution: {integrity: sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==} + '@eslint/js@9.7.0': + resolution: {integrity: sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': @@ -3273,8 +3280,8 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@8.0.0-alpha.46': - resolution: {integrity: sha512-qT5Zds2YwQntRiZfOYAXXy6Ezi1XsPKZ5z99yAFkexte/LcPNBEhdT2hdqwnVv2XR3STSSow4Kj2pfFVHzVhHA==} + '@typescript-eslint/eslint-plugin@8.0.0-alpha.49': + resolution: {integrity: sha512-kPSMXLyxC2Vkb1NIf8s5369KCkHqZNNRThyjNFiRIgoq10b2LIRsa9GNJ1nmsxLxDFeVD2c/JtqoR+FJVixywA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -3284,8 +3291,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.0.0-alpha.46': - resolution: {integrity: sha512-XXD1zsC4OEGbyQsp4OzydvOsrXb6GN9+NuAXTjl4ASU1OGKNg+OVLJuVdu6k2mtuZv0zBr+j8nOJ99z7lt4/iA==} + '@typescript-eslint/parser@8.0.0-alpha.49': + resolution: {integrity: sha512-DlXoouDziZOqQxYoFNTiEJJny6ycA246IA/urQqdpJEkxaPCTH6HDjLrq359abDMXVAO1PoDTPa4UmbBhsJzjQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -3294,12 +3301,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@8.0.0-alpha.46': - resolution: {integrity: sha512-mUXSpB78vwagK4++AtAkOCTaXIUwKb8DwrIQzxj55l6h8dIMtax/efwEMP0rATL6n6oy+QsG1qGHABZBmk8tqg==} + '@typescript-eslint/scope-manager@8.0.0-alpha.49': + resolution: {integrity: sha512-wjWDwvRRMRZZiNNjDMBfyC5TrWaoDlEc94oZ4ssu8iMG5WWfdiRk+umheuYoyr0jxdP80pi69JRP6auc5lvfKw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.0.0-alpha.46': - resolution: {integrity: sha512-JQQkrFEViCbQ/pR0ZVbtbXY5okwGc1I6egEo/hCmWiML80lHLe2TQgS6NJ6mZ4noTo0k1YDwh7HGSmn+gQCWtA==} + '@typescript-eslint/type-utils@8.0.0-alpha.49': + resolution: {integrity: sha512-iZj1fRAoyTGEDiNXEk/IjC3bLb0EP1e6YCH8wXIPTHuKj0mTt2NLwqF/TUUo9jNRAYk1I1E7/mnF7XB7Nq+D9g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3307,12 +3314,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@8.0.0-alpha.46': - resolution: {integrity: sha512-NvvbUafjBeownwQYZH0UOMJdwbzWaPErGflbLCtjeHxMF+zSeqkW3tsXkHJtujZ/J1OfyDfxybSLB0rHroBVxg==} + '@typescript-eslint/types@8.0.0-alpha.49': + resolution: {integrity: sha512-1VmsANJq31IAXbJHBpVoz7Q4oGvyF/60dLj17UeKwErJRNtUJaKtKl98vTJJ1mL9SK+8k5pPVY6NuzGV4/xsMA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.0.0-alpha.46': - resolution: {integrity: sha512-SCsZ6D8OwUpX8IYcmiIgRb2/AB7qW5EQSZmjfrNPglzCBH/r389EGw6+6p2D+j7fKYJlREEA22mVQztbbUKtZw==} + '@typescript-eslint/typescript-estree@8.0.0-alpha.49': + resolution: {integrity: sha512-W99PPqs2NAF6OhYfw0cQiiPEfjVJdFeRfyZp/8chz8Pn45q8Hb4fjVNySzPOPQ+tld5yDmZdACOVPED3HOlkSg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3320,14 +3327,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@8.0.0-alpha.46': - resolution: {integrity: sha512-dVh+7pv+9lF4cdhr3ZYjJIp04J4ZjKslkyr1VuA9g5nG5s8ENoznCnYsA3wXGu+pkJCIINb2VDFbz6O03c6Jgw==} + '@typescript-eslint/utils@8.0.0-alpha.49': + resolution: {integrity: sha512-7CshhaiHXhBS9dARhp6YZQKEfAzIJipde8gKGv19MJ9MrlmkPEN/bq2QcI3jmq5m+zYy8fVA/5v++qrvrNh5WQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@8.0.0-alpha.46': - resolution: {integrity: sha512-/foiKGq6SKu/HoLkCHsxjnvu1CsC6DTOA3lHJsb/ObTteIFZhh7ek7YAiChmyfZNclAdhjiLYDNp71ezBp2VGQ==} + '@typescript-eslint/visitor-keys@8.0.0-alpha.49': + resolution: {integrity: sha512-raajTta5+N2MHDV6NNItRCm8drGsJ+vxjaFu3q+iT2keNCf6kD8V08PhXfMCxoS9u1DtqQUsJ10T6ybmBoF0cQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@urql/core@2.3.6': @@ -3545,9 +3552,6 @@ packages: resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} engines: {node: '>= 0.4'} - array.prototype.toreversed@1.1.2: - resolution: {integrity: sha512-wwDCoT4Ck4Cz7sLtgUmzR5UV3YF5mFHUlbChCzZBQZ+0m2cl/DH3tKgvphv1nKgFsJ48oCSg6p91q2Vm0I/ZMA==} - array.prototype.tosorted@1.1.4: resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} engines: {node: '>= 0.4'} @@ -4558,19 +4562,19 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 - eslint-plugin-react@7.34.3: - resolution: {integrity: sha512-aoW4MV891jkUulwDApQbPYTVZmeuSyFrudpbTAQuj5Fv8VL+o6df2xIGpw8B0hPjAaih1/Fb0om9grCdyFYemA==} + eslint-plugin-react@7.35.0: + resolution: {integrity: sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA==} engines: {node: '>=4'} peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 eslint-plugin-turbo@2.0.8: resolution: {integrity: sha512-i5Y/3n+gjxHXg6JZMPpfaEDeCU18aq7yfILtNhZO5jJylp9t4JrOOkXBGqHT7K5JjGaP4Nsuz/i1hHrUUCpXfQ==} peerDependencies: eslint: '>6.6.0' - eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: @@ -4581,8 +4585,8 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.6.0: - resolution: {integrity: sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==} + eslint@9.7.0: + resolution: {integrity: sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true @@ -6354,10 +6358,6 @@ packages: resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} engines: {node: '>= 0.4'} - object.hasown@1.1.4: - resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==} - engines: {node: '>= 0.4'} - object.values@1.2.0: resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} @@ -6756,8 +6756,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.3.2: - resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} hasBin: true @@ -7499,6 +7499,9 @@ packages: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} engines: {node: '>= 0.4'} + string.prototype.repeat@1.0.0: + resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==} + string.prototype.trim@1.2.9: resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} @@ -7865,8 +7868,8 @@ packages: resolution: {integrity: sha512-8WbVAQAUlENo1q3c3zZYuy5k9VzBQvp8AX9WOtbvyWlLM1v5JaSRmjubLjzHF4JFtptjH/5c/i95yaElvcjC0A==} engines: {node: '>= 0.4'} - typescript-eslint@8.0.0-alpha.46: - resolution: {integrity: sha512-S3T/Taq3V2G1iZaT+VDOln+twi4k5iNIUJTIeoF12HEfImGXhTy1jarMxSipdwjHA/DhhCgOTJhjlzt3QiG+sw==} + typescript-eslint@8.0.0-alpha.49: + resolution: {integrity: sha512-nk8tq3jCV5MhZTd78vx2th9RjJlDs+mF+RERqOQQcGEP84xQm9DMDjFu10Cjw6JOWRUuQ14uA57vAQNLhmMlCA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -9587,13 +9590,15 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.6.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.7.0)': dependencies: - eslint: 9.6.0 + eslint: 9.7.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} + '@eslint/compat@1.1.1': {} + '@eslint/config-array@0.17.0': dependencies: '@eslint/object-schema': 2.1.4 @@ -9616,7 +9621,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.6.0': {} + '@eslint/js@9.7.0': {} '@eslint/object-schema@2.1.4': {} @@ -9996,14 +10001,14 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.2)': + '@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.3)': dependencies: '@babel/core': 7.24.7 '@babel/generator': 7.24.7 '@babel/parser': 7.24.7 '@babel/traverse': 7.24.7 '@babel/types': 7.24.7 - prettier: 3.3.2 + prettier: 3.3.3 semver: 7.6.2 transitivePeerDependencies: - supports-color @@ -11451,15 +11456,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.0.0-alpha.46(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3)': + '@typescript-eslint/eslint-plugin@8.0.0-alpha.49(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0)(typescript@5.5.3)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) - '@typescript-eslint/scope-manager': 8.0.0-alpha.46 - '@typescript-eslint/type-utils': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) - '@typescript-eslint/utils': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 8.0.0-alpha.46 - eslint: 9.6.0 + '@typescript-eslint/parser': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) + '@typescript-eslint/scope-manager': 8.0.0-alpha.49 + '@typescript-eslint/type-utils': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 8.0.0-alpha.49 + eslint: 9.7.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -11469,28 +11474,28 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3)': + '@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/scope-manager': 8.0.0-alpha.46 - '@typescript-eslint/types': 8.0.0-alpha.46 - '@typescript-eslint/typescript-estree': 8.0.0-alpha.46(typescript@5.5.3) - '@typescript-eslint/visitor-keys': 8.0.0-alpha.46 + '@typescript-eslint/scope-manager': 8.0.0-alpha.49 + '@typescript-eslint/types': 8.0.0-alpha.49 + '@typescript-eslint/typescript-estree': 8.0.0-alpha.49(typescript@5.5.3) + '@typescript-eslint/visitor-keys': 8.0.0-alpha.49 debug: 4.3.5 - eslint: 9.6.0 + eslint: 9.7.0 optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.0.0-alpha.46': + '@typescript-eslint/scope-manager@8.0.0-alpha.49': dependencies: - '@typescript-eslint/types': 8.0.0-alpha.46 - '@typescript-eslint/visitor-keys': 8.0.0-alpha.46 + '@typescript-eslint/types': 8.0.0-alpha.49 + '@typescript-eslint/visitor-keys': 8.0.0-alpha.49 - '@typescript-eslint/type-utils@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3)': + '@typescript-eslint/type-utils@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.0.0-alpha.46(typescript@5.5.3) - '@typescript-eslint/utils': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/typescript-estree': 8.0.0-alpha.49(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) debug: 4.3.5 ts-api-utils: 1.3.0(typescript@5.5.3) optionalDependencies: @@ -11499,12 +11504,12 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@8.0.0-alpha.46': {} + '@typescript-eslint/types@8.0.0-alpha.49': {} - '@typescript-eslint/typescript-estree@8.0.0-alpha.46(typescript@5.5.3)': + '@typescript-eslint/typescript-estree@8.0.0-alpha.49(typescript@5.5.3)': dependencies: - '@typescript-eslint/types': 8.0.0-alpha.46 - '@typescript-eslint/visitor-keys': 8.0.0-alpha.46 + '@typescript-eslint/types': 8.0.0-alpha.49 + '@typescript-eslint/visitor-keys': 8.0.0-alpha.49 debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 @@ -11516,20 +11521,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3)': + '@typescript-eslint/utils@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) - '@typescript-eslint/scope-manager': 8.0.0-alpha.46 - '@typescript-eslint/types': 8.0.0-alpha.46 - '@typescript-eslint/typescript-estree': 8.0.0-alpha.46(typescript@5.5.3) - eslint: 9.6.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0) + '@typescript-eslint/scope-manager': 8.0.0-alpha.49 + '@typescript-eslint/types': 8.0.0-alpha.49 + '@typescript-eslint/typescript-estree': 8.0.0-alpha.49(typescript@5.5.3) + eslint: 9.7.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@8.0.0-alpha.46': + '@typescript-eslint/visitor-keys@8.0.0-alpha.49': dependencies: - '@typescript-eslint/types': 8.0.0-alpha.46 + '@typescript-eslint/types': 8.0.0-alpha.49 eslint-visitor-keys: 3.4.3 '@urql/core@2.3.6(graphql@15.8.0)': @@ -11786,13 +11791,6 @@ snapshots: es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 - array.prototype.toreversed@1.1.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - array.prototype.tosorted@1.1.4: dependencies: call-bind: 1.0.7 @@ -12844,17 +12842,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.7.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) - eslint: 9.6.0 + '@typescript-eslint/parser': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) + eslint: 9.7.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -12862,9 +12860,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.6.0 + eslint: 9.7.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.6.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint@9.7.0) hasown: 2.0.2 is-core-module: 2.14.0 is-glob: 4.0.3 @@ -12875,13 +12873,13 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/parser': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jsx-a11y@6.9.0(eslint@9.6.0): + eslint-plugin-jsx-a11y@6.9.0(eslint@9.7.0): dependencies: aria-query: 5.1.3 array-includes: 3.1.8 @@ -12892,7 +12890,7 @@ snapshots: damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 es-iterator-helpers: 1.0.19 - eslint: 9.6.0 + eslint: 9.7.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 @@ -12901,38 +12899,38 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.0 - eslint-plugin-react-hooks@5.1.0-rc-512b09b2-20240718(eslint@9.6.0): + eslint-plugin-react-hooks@5.1.0-rc-512b09b2-20240718(eslint@9.7.0): dependencies: - eslint: 9.6.0 + eslint: 9.7.0 - eslint-plugin-react@7.34.3(eslint@9.6.0): + eslint-plugin-react@7.35.0(eslint@9.7.0): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 - array.prototype.toreversed: 1.1.2 array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.0.19 - eslint: 9.6.0 + eslint: 9.7.0 estraverse: 5.3.0 + hasown: 2.0.2 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 object.entries: 1.1.8 object.fromentries: 2.0.8 - object.hasown: 1.1.4 object.values: 1.2.0 prop-types: 15.8.1 resolve: 2.0.0-next.5 semver: 6.3.1 string.prototype.matchall: 4.0.11 + string.prototype.repeat: 1.0.0 - eslint-plugin-turbo@2.0.8(eslint@9.6.0): + eslint-plugin-turbo@2.0.8(eslint@9.7.0): dependencies: dotenv: 16.0.3 - eslint: 9.6.0 + eslint: 9.7.0 - eslint-scope@8.0.1: + eslint-scope@8.0.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -12941,13 +12939,13 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.6.0: + eslint@9.7.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.7.0) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.17.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.6.0 + '@eslint/js': 9.7.0 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 @@ -12956,7 +12954,7 @@ snapshots: cross-spawn: 7.0.3 debug: 4.3.5 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 + eslint-scope: 8.0.2 eslint-visitor-keys: 4.0.0 espree: 10.1.0 esquery: 1.5.0 @@ -15078,12 +15076,6 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 - object.hasown@1.1.4: - dependencies: - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - object.values@1.2.0: dependencies: call-bind: 1.0.7 @@ -15428,15 +15420,15 @@ snapshots: prelude-ls@1.2.1: {} - prettier-plugin-tailwindcss@0.6.5(@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.2))(prettier@3.3.2): + prettier-plugin-tailwindcss@0.6.5(@ianvs/prettier-plugin-sort-imports@4.3.0(prettier@3.3.3))(prettier@3.3.3): dependencies: - prettier: 3.3.2 + prettier: 3.3.3 optionalDependencies: - '@ianvs/prettier-plugin-sort-imports': 4.3.0(prettier@3.3.2) + '@ianvs/prettier-plugin-sort-imports': 4.3.0(prettier@3.3.3) prettier@2.8.8: {} - prettier@3.3.2: {} + prettier@3.3.3: {} pretty-bytes@5.6.0: {} @@ -16304,6 +16296,11 @@ snapshots: set-function-name: 2.0.2 side-channel: 1.0.6 + string.prototype.repeat@1.0.0: + dependencies: + define-properties: 1.2.1 + es-abstract: 1.23.3 + string.prototype.trim@1.2.9: dependencies: call-bind: 1.0.7 @@ -16698,11 +16695,11 @@ snapshots: typed-array-buffer: 1.0.2 typed-array-byte-offset: 1.0.2 - typescript-eslint@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3): + typescript-eslint@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.0-alpha.46(@typescript-eslint/parser@8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3))(eslint@9.6.0)(typescript@5.5.3) - '@typescript-eslint/parser': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) - '@typescript-eslint/utils': 8.0.0-alpha.46(eslint@9.6.0)(typescript@5.5.3) + '@typescript-eslint/eslint-plugin': 8.0.0-alpha.49(@typescript-eslint/parser@8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0)(typescript@5.5.3) + '@typescript-eslint/parser': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) + '@typescript-eslint/utils': 8.0.0-alpha.49(eslint@9.7.0)(typescript@5.5.3) optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d5d6a7201..8315bc2cb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,8 +8,8 @@ catalog: "@trpc/client": ^11.0.0-rc.466 "@trpc/react-query": ^11.0.0-rc.466 "@trpc/server": ^11.0.0-rc.466 - eslint: ^9.6.0 - prettier: ^3.3.2 + eslint: ^9.7.0 + prettier: ^3.3.3 typescript: ^5.5.3 zod: ^3.23.8 diff --git a/tooling/eslint/base.js b/tooling/eslint/base.js index 464411ba4..ed099a706 100644 --- a/tooling/eslint/base.js +++ b/tooling/eslint/base.js @@ -1,5 +1,7 @@ /// +import * as path from "node:path"; +import { includeIgnoreFile } from "@eslint/compat"; import eslint from "@eslint/js"; import importPlugin from "eslint-plugin-import"; import turboPlugin from "eslint-plugin-turbo"; @@ -33,10 +35,9 @@ export const restrictEnvAccess = tseslint.config({ }); export default tseslint.config( - { - // Globally ignored files - ignores: ["**/*.config.*"], - }, + // Ignore files not tracked by VCS and any config files + includeIgnoreFile(path.join(import.meta.dirname, "../../.gitignore")), + { ignores: ["**/*.config.*"] }, { files: ["**/*.js", "**/*.ts", "**/*.tsx"], plugins: { diff --git a/tooling/eslint/package.json b/tooling/eslint/package.json index ec08ccb43..c378bff71 100644 --- a/tooling/eslint/package.json +++ b/tooling/eslint/package.json @@ -14,10 +14,11 @@ "typecheck": "tsc --noEmit" }, "dependencies": { + "@eslint/compat": "^1.1.1", "@next/eslint-plugin-next": "^14.2.4", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.9.0", - "eslint-plugin-react": "^7.34.3", + "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "rc", "eslint-plugin-turbo": "^2.0.8", "typescript-eslint": "rc-v8"