Fix/next16 migration #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and updates across the codebase, focusing on ESLint configuration modernization, API route refactoring for tRPC endpoints, and increased code quality through stricter linting and conventions. The most significant changes are the migration to the new ESLint flat config, enhanced error logging and context creation in tRPC API routes, and the addition of new ESLint plugins and rules. Minor improvements include consistent code style, explicit ESLint disables, and updated import paths.
ESLint Configuration Modernization and Linting Improvements:
eslint.config.mjs, added support for TypeScript, React Hooks, and Next.js plugins, and updated rules for stricter linting and improved compatibility. Also, expanded ignored files and set up proper global variables.package.jsonto include new ESLint plugins and parser dependencies:@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslint-plugin-react-hooks.API Route Refactoring and Logging Enhancements:
src/app/api/public/[...trpc]/route.ts) with enhanced logging for requests, context creation, and error handling. Removed the old[trpc]/route.tsfile. (src/app/api/public/[...trpc]/route.tsR1-R22, src/app/api/public/[trpc]/route.tsL1-L13)[...trpc]/route.ts, added detailed logging for requests, context creation (including user email), and error handling. (src/app/api/trpc/[...trpc]/route.tsR8, src/app/api/trpc/[...trpc]/route.tsL16-R26)Code Quality and Consistency:
FaultyTerminal.tsx(e.g., double quotes, formatting, and minor refactoring). [1] [2] [3] [4] [5] [6] [7] [8] [9]Explicit ESLint Disables for React Hooks:
eslint-disable-next-linecomments for React Hooks rules in several files to suppress false positives or intentional violations (e.g.,set-state-in-effect,purity,static-components). [1] [2] [3] [4] [5]Summary of Most Important Changes:
ESLint and Linting:
eslint.config.mjs.package.json.API/tRPC Refactoring:
[...trpc]/route.tswith improved logging and error handling, and removed the old route file. (src/app/api/public/[...trpc]/route.tsR1-R22, src/app/api/public/[trpc]/route.tsL1-L13)Code Style and Quality:
FaultyTerminal.tsxand related files. [1] [2] [3] [4] [5] [6] [7] [8] [9]