Skip to content

chore: fix lint issues in public.ts route file (#173)#447

Merged
Harxhit merged 3 commits into
Dev-Card:mainfrom
rajesh-puripanda:chore/173-lint-cleanup-public-ts
Jun 11, 2026
Merged

chore: fix lint issues in public.ts route file (#173)#447
Harxhit merged 3 commits into
Dev-Card:mainfrom
rajesh-puripanda:chore/173-lint-cleanup-public-ts

Conversation

@rajesh-puripanda

Copy link
Copy Markdown
Contributor

Closes #173

Cleans up lint violations in \�pps/backend/src/routes/public.ts:

  • Reordered imports according to \import-x/order\ (sibling imports then type imports, each group separated by blank line)
  • Added explicit \Promise\ return type to \publicRoutes\ function
  • Removed extra blank lines after imports

Verification:
\
pnpm --filter backend lint
\
→ No errors or warnings for \public.ts.

@Dev-Card/maintainers

Resolve merge conflicts in apps/backend/src/routes/public.ts by
reconciling upstream's service-layer refactor with our lint cleanup:
- Accept upstream's architecture (publicService module, caching, qr-session endpoint)
- Apply our lint fixes (semicolons, trailing whitespace, braces for conditions)
- Add explicit : Promise<void> return type on publicRoutes
- Remove unused types/imports (moved to service layer)
- Prefix unused cacheKey as _cacheKey to satisfy no-unused-vars
@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label Jun 1, 2026
@Harxhit

Harxhit commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Could you please add unit tests , lint and type check terminals proofs

@rajesh-puripanda

Copy link
Copy Markdown
Contributor Author

Could you please add unit tests , lint and type check terminals proofs

Sure, working on it!
Give me a moment

@rajesh-puripanda

Copy link
Copy Markdown
Contributor Author

Terminal Proofs ?

1. Lint - public.ts passes cleanly

Exited with code � - no errors, no warnings.

px eslint apps/backend/src/routes/public.ts --quiet

(no output - clean pass) exit code: 0

2. Unit Tests - All 12 public.test.ts tests pass

�itest run src/tests/public.test.ts

`
? GET /api/public/:username/qr - size validation
? rejects size=0 with 400 before any DB query
? rejects size=-1 with 400 before any DB query
? rejects size=50000 (above upper bound) with 400
? rejects size=2049 (one above upper bound) with 400
? rejects non-numeric size (abc) with 400
? rejects floating-point size (400.5) with 400
? accepts size=1 (lower bound) and returns PNG
? accepts size=2048 (upper bound) and returns PNG
? defaults to size=400 when no size param is provided
? returns SVG when format=svg is requested
? returns 404 for an unknown username (valid size)
? returns 500 when QR generation throws

Test Files 1 passed (1)
Tests 12 passed (12)
`

3. Full test suite (100 passed / 7 pre-existing failures)

The 7 failures are pre-existing in event.test.ts and �pp.test.ts (env-related - process.exit due to missing JWT_SECRET/ENCRYPTION_KEY in test env, and an unrelated attendees pagination issue). They are not caused by this PR's changes, which are scoped to public.ts only.

Ready for merge! ??

@rajesh-puripanda rajesh-puripanda force-pushed the chore/173-lint-cleanup-public-ts branch from 5732b94 to 26c0347 Compare June 6, 2026 19:29
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@rajesh-puripanda is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

CI — Checks Failed

Backend — FAIL

Check Result
Lint PASS
Test PASS
Typecheck FAIL

Mobile — SKIP

Check Result
Lint -
Test -

Web — SKIP

Check Result
Check -
Build -

Last updated: Sat, 06 Jun 2026 19:30:28 GMT

@rajesh-puripanda

Copy link
Copy Markdown
Contributor Author

Update: Typecheck & Lint Issues Resolved

Typecheck: All 15 TypeScript errors are fixed. Root cause was a missing \prisma generate\ - after generating the Prisma client, \TeamRole, \PrismaClientKnownRequestError, and all implicit \�ny\ parameters are now properly resolved. \ sc --noEmit\ passes with 0 errors.

Lint: \src/routes/public.ts\ passes with 0 errors, 0 warnings (scope of this PR).

Merge conflicts: Resolved - branch merged with latest \upstream/main.

Files verified clean:

  • \�pps/backend/src/routes/public.ts\ ? lint & typecheck pass
  • \�pps/backend/src/utils/error.util.ts\ ? typecheck pass
  • \�pps/backend/src/routes/team.ts\ ? typecheck pass
  • \�pps/backend/src/services/publicService.ts\ ? typecheck pass
  • \�pps/backend/src/tests/team.test.ts\ ? typecheck pass

Ready for review and merge. Marking as critical since the typecheck failure was blocking CI.

@Harxhit Harxhit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally tested. LGTM approving

@Harxhit Harxhit merged commit 1b9430a into Dev-Card:main Jun 11, 2026
4 of 6 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Congratulations @rajesh-puripanda on getting PR #447 merged!

Thank you for your contribution to the project.

To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the #get-labels channel on our Discord server and share your merged PR link.

Harxhit pushed a commit to Harxhit/DevCard that referenced this pull request Jun 21, 2026
ShantKhatri pushed a commit to ShantKhatri/DevCard that referenced this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Lint Cleanup for public.ts Route File

2 participants