gita / gita-frontend-v2

Frontend for BhagavadGita.io v2
https://bhagavadgita.io
MIT License
43 stars 53 forks source link

Switch to `strict: true` in tsconfig.json #205

Closed elmeister closed 1 year ago

elmeister commented 1 year ago

Summary by CodeRabbit

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bg-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 4, 2023 0:10am
bhagavad-gita ✅ Ready (Inspect) Visit Preview Sep 4, 2023 0:10am
github-actions[bot] commented 1 year ago

Image description CodeRabbit

Walkthrough

This pull request includes a variety of changes across the codebase, focusing on improving type safety, error handling, and maintainability. The updates include refactoring import statements, adding explicit types to function parameters and state variables, enhancing null checks, and updating Redux actions and reducers.

Changes

Files Summary
src/app/chapter/[chapterNumber]/(chapter)/[[...locale]]/ChapterPage.tsx,
src/app/chapter/[chapterNumber]/verse/[verseNumber]/[[...locale]]/VersePage.tsx,
src/app/verse-of-the-day/[[...locale]]/VerseOfTheDay.tsx,
src/components/AuthorSettings.tsx,
src/components/BookmarkCard.tsx,
src/components/Footers/Footer.tsx,
src/components/Headers/LanguageDropdown.tsx,
src/components/NotesCard/index.tsx,
src/components/Quotes/Quote.tsx,
src/components/Verse/Commentary.tsx,
src/components/Verse/Translation.tsx,
src/components/Footers/FooterBar.tsx,
src/app/login/[[...locale]]/page.tsx,
src/app/signup/[[...locale]]/page.tsx,
src/components/Home/Newsletter.tsx,
src/middleware.ts
Updated import statements, added explicit types, improved error handling, and removed unused variables.
src/app/notes/[[...locale]]/page.tsx,
src/components/NotesCard/types.ts,
src/components/Chapter/VerseList.tsx,
src/components/Chapter/VerseNavigator.tsx,
src/components/Chapter/functions.ts,
src/components/Headers/AudioPlayer.tsx,
src/components/Headers/ChapterHeader.tsx,
src/components/Headers/IndexHeader.tsx,
src/components/Headers/PageHeader.tsx,
src/components/Verse/index.tsx
Refactored import statements, updated useState hook with explicit types, introduced new exported type, and improved modularity.
src/components/LinkWithLocale.tsx,
src/components/NotesModal.tsx,
src/components/Settings.tsx,
src/shared/functions.ts,
src/hooks/useAdvancedSettings.ts,
src/lib/getDailyVerse.ts,
src/lib/getVerseData.ts
Enhanced null checks, removed unused imports, updated function return types, and improved error handling.
src/redux/Types.ts,
src/redux/actions/main.ts,
src/redux/actions/settings.ts,
src/redux/constants.ts,
src/redux/reducers/main.ts,
src/redux/reducers/settings.ts,
src/redux/store.ts,
src/redux/types.ts
Removed exported constants, updated Redux actions and reducers, added type annotations, and improved type safety.

"In the land of code where the shadows lie,

We refactor, update, and simplify.

With each pull request, we aim to enhance,

Our code's performance, its elegant dance 🐇💃🎉"


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.