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

Create .prettierrc #347

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Create .prettierrc #347

merged 1 commit into from
Jan 25, 2022

Conversation

tordans
Copy link
Collaborator

@tordans tordans commented Jan 10, 2022

Solves #333.

Adds a config so users of https://prettier.io/ use the same formatting that does not change too much.

This might help to make sure editors that have prettier running don't change too much of the format. Might need tweaking.
@tyrasd
Copy link
Member

tyrasd commented Jan 25, 2022

Are you sure this works? As far as I can see, prettier is only meant to format javascript code and doesn't do anything with .json files, which is what we would need here. See prettier/prettier#322 (comment). Am I overlooking something here? //edit: OK, it seems that ticket was a bit outdated. Ignore this – prettier also works fine for json files.

What we could (also) do is to add a .editorconfig file to define indentation and newline properties. Something like this should work.

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[**.json]
indent_style = space
indent_size = 4

[{package.json,.package-lock.json}]
indent_style = space
indent_size = 2

@tyrasd tyrasd added waitfor-info something is unclear with the suggestion, more information is needed to evaluate this feature reques enhancement New feature or request and removed waitfor-info something is unclear with the suggestion, more information is needed to evaluate this feature reques labels Jan 25, 2022
@tyrasd tyrasd merged commit 627ced3 into openstreetmap:main Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants