-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move sizing constants into theme and remove 'any' types
- **Removed `constants.ts`**: - Deleted `constants.ts` which contained `TITLE_SIZE`, `SUBTITLE_SIZE`, and `TEXT_SIZE`. - **Centralized Sizing in Theme**: - Extended the Material-UI theme by adding a `sizes` property in `theme.ts`. - Declared custom theme interfaces to include `sizes` with `title`, `subtitle`, and `text`. - Updated components to use `theme.sizes` instead of importing constants. - Adjusted imports and styled components accordingly. - **Improved Type Safety**: - Replaced `any` type assertions with more specific types or `unknown` where appropriate. - Changed image module declarations in `images.d.ts` from `any` to `string`. - Updated test files to use correct type assertions instead of `any`. - Added `NumericKeys` utility type in `types.ts` for better type inference. - Added ESLint disable comment in `jest.preset.js` to suppress `@typescript-eslint/no-require-imports` warning. - **Updated Scripts and Documentation**: - Renamed `format` script to `lint:prettier:fix` in `package.json` and `README.md` for clarity. - Added `lint:eslint` script to run ESLint. - **Code Style Adjustments**: - Modified components to align with updated linting and formatting rules. - Ensured consistent usage of `theme.sizes` across all components. - Removed unused imports and variables in various files. These changes improve type safety by eliminating unnecessary `any` types and centralize sizing constants within the theme for consistent styling across the application.
- Loading branch information
1 parent
eaee25a
commit 9be7b51
Showing
14 changed files
with
84 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
const nxPreset = require('@nx/jest/preset').default; | ||
|
||
module.exports = { ...nxPreset }; |
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
declare module '*.png' { | ||
const content: any; | ||
const content: string; | ||
export default content; | ||
} | ||
|
||
declare module '*.jpg' { | ||
const content: any; | ||
const content: string; | ||
export default content; | ||
} | ||
|
||
declare module '*.jpeg' { | ||
const content: any; | ||
const content: string; | ||
export default content; | ||
} | ||
|
||
declare module '*.svg' { | ||
const content: any; | ||
const content: string; | ||
export default content; | ||
} |