-
Notifications
You must be signed in to change notification settings - Fork 318
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
chore: ts strict fixes for ui theme #3400
Conversation
🦋 Changeset detectedLatest commit: a8d9c4c The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/ui/src/theme/utils.ts
Outdated
@@ -65,7 +65,7 @@ export function isDesignToken(value: unknown): value is WebDesignToken { | |||
return isObject(value) && has(value, 'value'); | |||
} | |||
|
|||
export function isShadowToken(value: unknown): value is ShadowValue { | |||
export function isShadowToken(value: unknown): value is ShadowValue & object { |
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.
Fairly certain that the definition of ShadowValue
can resolve to either an object
of shadow props or string
. Not fully related to this PR but maybe we should rename this to something more explicit
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.
good point, isShadowObject
it is
declare module 'style-dictionary/lib/utils/references/usesReference.js' { | ||
// based on the typing specified by style-dictionary: | ||
// https://github.com/amzn/style-dictionary/blob/main/lib/utils/references/usesReference.js | ||
export default function usesReference(value: string): boolean; |
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.
Is there potential for drift on these types? I'm assuming these types cannot be exported from style-dictionary, is that correct?
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.
That is correct, something if I ever get time to do I would like to rewrite the whole thing in TS and expose the correct types with better exports so we don't have to import specific files. There are a lot of projects that do this so I promise not to break any of these paths :)
a8d9c4c
Description of changes
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.