-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColorPicker: Fix typing errors #38430
Conversation
Size Change: +1 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for splitting out all these little TS changes @aaronrobertshaw!
✅ Confirmed errors messages when adding "src/color-picker/**/*"
to the tsconfig.json
file prior to this PR
✅ Adding // @ts-nocheck
for the circular option picker and color palette until we're ready to type them makes good sense
✅ Removal of unused imports looks good
✅ Checked that calling colord()
with undefined
or ''
both return black as the colour, so the change to using ''
as a fallback doesn't affect anything
✅ Explicit return undefined
on getColorFromLegacyProps
looks good
✅ Smoke tested the color picker in the editor and in Storybook
LGTM!
Changelog for this will be added via: #38469 |
This must have been the reason why we never noticed the TS errors before — we must have forgotten that line 😅 Thank you both! |
Related: #37769
Description
This PR fixes a number of typing errors that occur with the
ColorPicker
.ColorPalette
to thetsconfig.json
ColorPicker
andCircularOptionPicker
colord
incolor-picker/component.tsx
color-picker/color-input.tsx
andcolor-picker/color-display.tsx
Colord
type incolor-picker/color-input.tsx
andcolor-picker/color-display.tsx
color-picker/use-deprecated-props
and itsgetColorFromLegacyProps
fucntion// @ts-nocheck
to the following files to avoid going further down the rabbit hole:packages/components/src/color-palette/index.js
packages/components/src/circular-option-pickerindex.js
(These can be typed when or if those components are converted to TypeScript)
Testing Instructions
"src/color-picker/**/*",
to thepackages/components/tsconfig.json
npm run build:package-types
( should get 68 errors )npm run build:package-types
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).