Skip to content

Commit

Permalink
test adding lint and formating check to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidansunbury committed Jan 15, 2025
1 parent 897ae87 commit e84958e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
appRouter: ["true", "false"]
drizzle: ["true", "false"]
dbType: ["planetscale", "sqlite", "mysql", "postgres"]
# linter: ["eslint", "biome"]

name: "Build and Start T3 App ${{ matrix.trpc }}-${{ matrix.tailwind }}-${{ matrix.nextAuth }}-${{ matrix.prisma }}-${{ matrix.drizzle}}-${{ matrix.appRouter }}-${{ matrix.dbType }}"
steps:
Expand Down Expand Up @@ -66,6 +67,9 @@ jobs:
AUTH_DISCORD_SECRET: baz
SKIP_ENV_VALIDATION: true

# WIP ensure that generated app passes formatting and linting checks
- run: pnpm format:check && pnpm check

build-t3-app-with-bun:
runs-on: ubuntu-latest

Expand Down
8 changes: 8 additions & 0 deletions cli/src/helpers/format.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { execa } from "execa";

Check failure on line 1 in cli/src/helpers/format.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'execa' is defined but never used

import { logger } from "~/utils/logger.js";

Check failure on line 3 in cli/src/helpers/format.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'logger' is defined but never used

//! WIP not implemented yet

// Ensures that generated project is tidy after init according to selected formatter
export const formatProject = (eslint: boolean, biome: boolean) => {};

Check failure on line 8 in cli/src/helpers/format.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'eslint' is defined but never used. Allowed unused args must match /^_/u

Check failure on line 8 in cli/src/helpers/format.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'biome' is defined but never used. Allowed unused args must match /^_/u

Check failure on line 8 in cli/src/helpers/format.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected empty arrow function
4 changes: 3 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const main = async () => {
const {
appName,
packages,
flags: { noGit, noInstall, importAlias, appRouter },
flags: { noGit, noInstall, importAlias, appRouter, eslint },

Check failure on line 41 in cli/src/index.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'eslint' is assigned a value but never used
databaseProvider,
} = await runCli();

Expand Down Expand Up @@ -89,6 +89,8 @@ const main = async () => {
await initializeGit(projectDir);
}

// TODO run format command

await logNextSteps({
projectName: appDir,
packages: usePackages,
Expand Down
6 changes: 3 additions & 3 deletions cli/src/installers/biome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export const biomeInstaller: Installer = ({ projectDir }) => {
addPackageScript({
projectDir,
scripts: {
"format:unsafe": "biome check --write --unsafe .",
"format:write": "biome check --write .",
"format:check": "biome check .",
"check:unsafe": "biome check --write --unsafe .",
"check:write": "biome check --write .",
check: "biome check .",
},
});
};
5 changes: 4 additions & 1 deletion cli/template/extras/src/trpc/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const getQueryClient = () => {
return createQueryClient();
}
// Browser: use singleton pattern to keep the same query client
return (clientQueryClientSingleton ??= createQueryClient());
if (!clientQueryClientSingleton) {
clientQueryClientSingleton = createQueryClient();
}
return clientQueryClientSingleton;
};

export const api = createTRPCReact<AppRouter>();
Expand Down

0 comments on commit e84958e

Please sign in to comment.