Fix tsc declaration errors for @mui/icons-material deep imports#359
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes TypeScript TS7016 declaration errors in the frontend by eliminating deep imports from @mui/icons-material and switching to the package’s barrel (named) exports, aligning with existing import usage elsewhere in the codebase.
Changes:
- Replaced deep icon imports (
@mui/icons-material/Delete,@mui/icons-material/Edit) with barrel imports from@mui/icons-material. - Aliased
DeleteandEditexports to preserve existing component names (DeleteIcon,EditIcon) without changing JSX usage.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/Labels/LabelView.tsx | Switches MUI icon imports to barrel exports to resolve missing declaration errors in yarn tsc. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
yarn tscfailed with TS7016 errors becausefrontend/src/views/Labels/LabelView.tsxused deep imports (@mui/icons-material/Deleteand@mui/icons-material/Edit) that lack bundled declaration files in the current install:'n src/views/Labels/LabelView.tsx(15,24): error TS7016: Could not find a declaration file for module '@mui/icons-material/Delete' src/views/Labels/LabelView.tsx(16,22): error TS7016: Could not find a declaration file for module '@mui/icons-material/Edit''nFix
Switched to the named barrel import
import { Add, Delete as DeleteIcon, Edit as EditIcon } from '@mui/icons-material', matching the convention used by every other file in the codebase.yarn tscandyarn lintnow pass cleanly.