Skip to content

fix(fib): add type annotations and strict equality for ESLint compliance#3

Merged
DeepakReddyG merged 1 commit intomainfrom
fix-fib-type-safety
Aug 24, 2025
Merged

fix(fib): add type annotations and strict equality for ESLint compliance#3
DeepakReddyG merged 1 commit intomainfrom
fix-fib-type-safety

Conversation

@DeepakReddyG
Copy link
Copy Markdown
Owner

Changes

  • Added n: number and : number type annotations to the fibonacci function in fib.ts to fix ESLint errors (@typescript-eslint/no-unsafe-return, @typescript-eslint/restrict-plus-operands).
  • Changed == to === for strict equality checks.

Testing

  • Ran npm run lint in the terminal to check for ESLint errors in fib.ts—no errors showed up.
  • Tested the fibonacci function with fibonacci(5) (got 8), fibonacci(0) (got 0), and fibonacci(-1) (got -1) to make sure it works.
  • Checked that fibRoute.ts still works with the updated fib.ts by testing GET /5 in my app (it returned fibonacci(5) is 8).

Fixes #1

@DeepakReddyG DeepakReddyG self-assigned this Aug 24, 2025
@DeepakReddyG DeepakReddyG merged commit 3360a79 into main Aug 24, 2025
1 check failed
@DeepakReddyG DeepakReddyG deleted the fix-fib-type-safety branch August 24, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type Safety Issues in fib.ts: Add Type Annotations to Resolve ESLint Errors

1 participant