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

Update description for format.formatter #363

Merged
merged 1 commit into from
Apr 24, 2020
Merged

Conversation

ryanfitzer
Copy link
Contributor

Description of changes:

Make it clear that the function is bound to the file object.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Make it clear that the function is bound to the file object.
@ryanfitzer
Copy link
Contributor Author

I think this will help to document the current behavior.

For a future release, I think the current file object should be passed to the function, instead. Example (avoids a breaking change):

StyleDictionary.registerFormat({
  name: 'json',
  formatter: function(dictionary, config, file) {
    return JSON.stringify(dictionary.properties, null, 2);
  }
})

Copy link
Member

@dbanksdesign dbanksdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

I like your suggestion about having the file object as a parameter rather than binding the context to it... I forget why we did that in the first place...

@ryanfitzer
Copy link
Contributor Author

Any changes needed to get this merged?

@chazzmoney
Copy link
Collaborator

LGTM! :shipit:

@chazzmoney chazzmoney merged commit 19c9797 into amzn:master Apr 24, 2020
dbanksdesign pushed a commit that referenced this pull request Oct 5, 2020
Make it clear that the function is bound to the file object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants