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

fix: prevent yarn content move from converting double quotes to single quotes #8623

Merged
merged 1 commit into from
May 5, 2023

Conversation

OnkarRuikar
Copy link
Contributor

Problem

We prefer double quotes in front-matter YAML to wrap title attributes with special characters.
At the moment in content repo we have ~5514 double double quotes and only ~147 single quotes.

But the yarn content move converts double quotes to singe quotes:

title: "AbortSignal: abort() static method"
to
title: 'AbortSignal: abort() static method'

This pushes unnecessory changes to the content repo and confuses reviewers.

Solution

Configure js-yaml.dump() method to use double quotes:

yaml.dump(saveMetadata, {quotingType: '"'})}

Testing

Tested yarn content move locally with and without the changes.

@OnkarRuikar
Copy link
Contributor Author

@teoli2003
Copy link
Contributor

This will prevent a robot war between Prettier and Yari 🤣 As the former changes them into " and yarn move into '.

🤖 vs 🤖

Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

Thanks and sorry for the delay. 🙏

@fiji-flo fiji-flo merged commit 7da24a4 into mdn:main May 5, 2023
@OnkarRuikar OnkarRuikar deleted the doublequotes_in_frontmatter branch May 5, 2023 15:18
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