TS Migration#115
Conversation
WalkthroughAdds TypeScript support and ESLint TypeScript integration: new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.gitignore (1)
124-135: Remove duplicate .vscode/ entry.The
.vscode/entry appears twice in the file (lines 124 and 135). Remove one to avoid redundancy.Apply this diff to remove the duplicate:
# Misc .DS_Store -.vscode/
🧹 Nitpick comments (1)
.eslintrc.json (1)
6-9: Consider adding TypeScript ESLint recommended configurations.The
extendsarray doesn't include the recommended TypeScript ESLint configurations. Adding these will provide better default rules for TypeScript code.Apply this diff to include recommended TypeScript ESLint configs:
"extends": [ "plugin:react/recommended", - "airbnb" + "airbnb", + "plugin:@typescript-eslint/recommended" ],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
.eslintrc.json(2 hunks).gitignore(1 hunks)package.json(1 hunks)src/components/BannerPhoto/BannerPhoto.tsx(1 hunks)src/react-app-env.d.ts(1 hunks)tsconfig.json(1 hunks)
🔇 Additional comments (5)
tsconfig.json (1)
1-26: LGTM! TypeScript configuration is appropriate for React 17.The configuration correctly uses
"jsx": "react-jsx"for React 17's new JSX transform and enables strict type checking, which is good for a TypeScript migration..eslintrc.json (1)
35-35: Disabling no-undef is appropriate for TypeScript.Setting
no-undef: 0is correct when using TypeScript, as TypeScript's compiler handles undefined variable detection more accurately than ESLint.src/components/BannerPhoto/BannerPhoto.tsx (2)
5-9: Type definition is correct and comprehensive.The
BannerPhotoPropsinterface properly defines all props with appropriate types including optional props using?.
12-12: React.FC usage is acceptable for this migration.Using
React.FC<BannerPhotoProps>is a valid approach for typing functional components. Note that in React 18+,React.FCno longer implicitly includeschildren, so explicitly defining it in props (as done here) is actually forward-compatible.src/react-app-env.d.ts (1)
1-16: LGTM! Standard CSS Modules type declarations.The ambient module declarations correctly enable TypeScript support for CSS Modules. The
{ [key: string]: string }type accurately represents CSS module exports where class names are mapped to scoped strings.
ChrisYx511
left a comment
There was a problem hiding this comment.
merge when you see fit
| "max-len": 1, | ||
| "indent": ["error", 2], | ||
| "max-classes-per-file": 0 | ||
| "max-classes-per-file": 0, |
There was a problem hiding this comment.
Review these eslint options to make sure you actually need them
| ] | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^24.10.1", |
There was a problem hiding this comment.
Make sure your versions are compatible here.
| "esnext" | ||
| ], | ||
| "allowJs": true, | ||
| "skipLibCheck": true, |
There was a problem hiding this comment.
Make sure your TS options are as strict as possible for the current given configuration.
|
This change is part of the following stack: Change managed by git-spice. |
Description
Added TypeScript dependencies to package.json and tested by porting banner photo (which is going to be replaced with redesign anyways). Should be setup to start brand new redesign completely in TypeScript!
This PR is part of #47
Developer Testing
Testing done:
This change is
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.