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

revert parser for json files #290

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

tekhaus
Copy link
Collaborator

@tekhaus tekhaus commented Oct 18, 2023

This commit resolves #268.

The conflict was not in the prettier settings per se. Instead, when lint-staged is run as the last step before a commit, it is invoked using npx and the remote config is using the json parser on JSON files. The other tooling for the repo, most specifically vscode, uses json-stringify for the JSON parser.

This difference in parsers was causing the locally-built (via build script) and committed JSON task files to be reformatted with arrays on a single line. Using the json-stringify parser will instead keep the arrays as multiline, which aligns with how all of the JSON task files have existed in the library prior to adding prettier to the repo.

To preserve the usage of Shopify's prettier settings, a new prettier.config.js file was created to import and export those settings while adding an override on the JSON parser.

This commit also updates the affected task JSON files that were committed since the prettier addition.

@tekhaus tekhaus requested a review from isaacbowen October 18, 2023 17:17
Copy link
Member

@isaacbowen isaacbowen left a comment

Choose a reason for hiding this comment

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

This is a beautiful approach. :) Thank you!

@tekhaus
Copy link
Collaborator Author

tekhaus commented Oct 18, 2023

Will this cause all of the updated task to show as Updated in the interface?

@isaacbowen
Copy link
Member

Will this cause all of the updated task to show as Updated in the interface?

No, because their actual attributes have not changed. :) Glad you're thinking about that though!

@tekhaus tekhaus merged commit 32112cc into lightward:main Oct 18, 2023
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conflicting prettier settings
2 participants