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

challenge(formatter): add lineEnding option #786

Merged
merged 12 commits into from Nov 19, 2023

Conversation

SuperchupuDev
Copy link
Member

@SuperchupuDev SuperchupuDev commented Nov 19, 2023

Summary

The Prettier challenge requires us to add all Prettier options relevant when formatting JS

This PR adds a lineEnding option, with the following values:

  • lf
  • crlf
  • cr

Test Plan

Added one new test, line-ending.js

@github-actions github-actions bot added A-Project Area: project A-Formatter Area: formatter A-Website Area: website L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages labels Nov 19, 2023
@github-actions github-actions bot added the A-CLI Area: CLI label Nov 19, 2023
@github-actions github-actions bot added the A-Changelog Area: changelog label Nov 19, 2023
@SuperchupuDev SuperchupuDev marked this pull request as ready for review November 19, 2023 19:07
@SuperchupuDev SuperchupuDev requested review from a team November 19, 2023 19:07
@ematipico ematipico merged commit fa7894d into main Nov 19, 2023
17 checks passed
@ematipico ematipico deleted the superchupu/challenge/end-of-line branch November 19, 2023 21:33
@LivSarah
Copy link

LivSarah commented Dec 5, 2023

Is there a specific reason why the auto option was not included ? (:
(ref: Prettier options)

I'm currently working on a project where we use Biome, and we're having problems with (what I assume has to be) the line-endings. We faced a similar problem when using prettier/eslint in a different project, and the best solution turned out to use the auto option for line endings. 🤔

Edit:
I saw that the original issue also specifically mentioned "auto".

@ematipico
Copy link
Member

Some of us had reservations about options that aren't predictable, such as this auto and quoteProps="consistent". These can cause different outputs depending on the machines of the users.

In particular for line ending, some of us thought that users should use git to solve line endings resolutions among files.

@LivSarah
Copy link

LivSarah commented Dec 5, 2023

As I usually prefere to keep things like this predictable myself, I can understand to some degree. I just also aknowledge the need for "grey areas" once in a while I think. 😅

So this means it was a conscious decision to leave out "auto" when adding the lineEnding option, and that there is no point in creating an issue for it? 😇

@ematipico
Copy link
Member

You could create a GitHub discussion and build a case for the option! Why you need it, explain your use case, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Formatter Area: formatter A-Project Area: project A-Website Area: website L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants