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

Inconsistent Formatting between Prettier and Org #4162

Open
jonny-harte opened this issue May 26, 2022 · 10 comments
Open

Inconsistent Formatting between Prettier and Org #4162

jonny-harte opened this issue May 26, 2022 · 10 comments
Labels
area:lwc status:needs eng review type:enhancements Feedback to take into account for existing features

Comments

@jonny-harte
Copy link

Summary

Every time you retrieve source from Org it detects all Aura & LWC components as different when using prettier and/or the pre-commit hook in a project. This is because prettier adds a new lines to the end of files and the Org removes them.

This has become more of an issue since the updated source control and is making diff detection very noisy and unmanageable in large projects.

I know there is an prettier-plugin-apex plugin which removes the last line (works well!). Could this be expanded to all file types with options in .prettierrc?

Steps To Reproduce:

  1. Create an Aura/LWC.
  2. Prettier files.
  3. Commit to Repo.
  4. Deploy to Org.
  5. Retrieve from Org.
  6. Review source control panel in VSCode

Expected result

No Changes detected.

Actual result

Changes detected, last line from files removed.

Salesforce Extension Version in VS Code:
v54.12.0

SFDX CLI Version:
sfdx-cli/7.150.0 darwin-x64 node-v16.15.0

OS and version:
MacOS 12.3.1

@floralan floralan added area:lwc type:enhancements Feedback to take into account for existing features and removed status:needs eng review labels Jun 2, 2022
@floralan
Copy link
Contributor

floralan commented Jun 2, 2022

Hi @jonny-harte, thank you for your post. This is a known issue, we will be working on this to provide you with a better experience. Please stay tuned.

@jonny-harte
Copy link
Author

Thanks @floralan. Will this take into account visualforce pages, components and email templates etc? As there are a lot of inconsistencies between whats deployed after being formatted with prettier and what i then retrieved from the Org.

@gfarb
Copy link

gfarb commented Oct 13, 2022

Would love to see some activity on this issue. Some other examples of this, even with prettier-plugin-apex, are Role, Layout and WebLink metadata files. Would be great if we could use apexInsertFinalNewline for all Salesforce metadata files.

@ozanbotanls
Copy link

Is there any movement for this one? @floralan

@RupertBarrow
Copy link

Please could you tell us about this is going ?

@floralan
Copy link
Contributor

Sorry for the late reply as I'm not working on this product anymore.
@AnanyaJha Could you please follow up on this issue?

@gfarb
Copy link

gfarb commented Feb 16, 2023

@AnanyaJha any updates for us? While I appreciate all the work that has gone into prettier-plugin-apex that work is being done by folks in the community and not Salesforce themselves. The plugin is not very efficient and in large projects it consumes a ton of hardware resources (my computer sounds like a rocket ship about to take off).

@AnanyaJha
Copy link
Collaborator

Hi @gfarb thanks for bumping this. We'll start triaging this and will let you know once we've pulled it into our backlog.

@RupertBarrow
Copy link

Hi @AnanyaJha , are you making progress on this one ?

@gfarb
Copy link

gfarb commented Jul 20, 2023

Still no progress or updates on this?

@AnanyaJha @floralan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:lwc status:needs eng review type:enhancements Feedback to take into account for existing features
Projects
None yet
Development

No branches or pull requests

6 participants