Skip to content
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

Incorrect type definition for StyleDictionary.transformGroup #697

Closed
isaiahtaylor opened this issue Sep 17, 2021 · 2 comments
Closed

Incorrect type definition for StyleDictionary.transformGroup #697

isaiahtaylor opened this issue Sep 17, 2021 · 2 comments

Comments

@isaiahtaylor
Copy link

Version: style-dictionary 3.0.2

This sample:

const StyleDictionary = require('style-dictionary');

console.log(StyleDictionary.transformGroup['scss']);

Outputs:

[
    'attribute/cti',
    'name/cti/kebab',
    'time/seconds',
    'content/icon',
    'size/rem',
    'color/css'
  ]

That would imply transformGroup has a type of Record<string, string[]>.

However, its current definition is:

transformGroup: Record<string, TransformGroup>;

And the definition of TransformGroup:

export interface TransformGroup {
name: string;
transforms: string[];
}

This causes an error in Typescript when you try to grab elements of that array.

@dbanksdesign
Copy link
Member

Thanks for raising this @isaiahtaylor I just made a PR fixing this bug, #729 if you'd like to take a look.

@chazzmoney
Copy link
Collaborator

Fixed in #729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants