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

task/1574 allow overriding prettier parser in config #1575

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

BlakeTnr
Copy link
Contributor

@BlakeTnr BlakeTnr commented Aug 16, 2024

PR details

What changes did you make? (Give an overview)

Further details (optional)

...

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • [n/a ] test scripts updated
  • [n/a ] Wiki updated (if applicable)

@JoernBerkefeld JoernBerkefeld changed the base branch from main to develop August 19, 2024 06:57
@JoernBerkefeld JoernBerkefeld linked an issue Aug 19, 2024 that may be closed by this pull request
2 tasks
@JoernBerkefeld JoernBerkefeld changed the title #1574 Fix overwriting parser bug/1574 Fix overwriting parser Aug 19, 2024
@JoernBerkefeld JoernBerkefeld changed the title bug/1574 Fix overwriting parser task/1574 allow overriding prettier parser in config Aug 19, 2024
@JoernBerkefeld JoernBerkefeld added c/asset COMPONENT c/query COMPONENT c/script COMPONENT chore Jira issue-type "Task" labels Aug 19, 2024
@JoernBerkefeld
Copy link
Contributor

given that test cases all check out I'll merge your PR.
have you considered that the prettier config is loaded once per metadata type during retrieval?
search the code for File.initPrettier() calls:
image

sooo, it might just not have the big impact that you expect

@JoernBerkefeld JoernBerkefeld added this to the 7.1.5 milestone Aug 19, 2024
@JoernBerkefeld JoernBerkefeld merged commit c4a8dae into Accenture:develop Aug 19, 2024
5 of 6 checks passed
@BlakeTnr
Copy link
Contributor Author

given that test cases all check out I'll merge your PR. have you considered that the prettier config is loaded once per metadata type during retrieval? search the code for File.initPrettier() calls: image

sooo, it might just not have the big impact that you expect

I have not considered this, I will look into this tomorrow. I know that this just worked for our use case because we only needed to override for an entire metadata type.

@BlakeTnr
Copy link
Contributor Author

BlakeTnr commented Aug 20, 2024

given that test cases all check out I'll merge your PR. have you considered that the prettier config is loaded once per metadata type during retrieval? search the code for File.initPrettier() calls: image

sooo, it might just not have the big impact that you expect

Yeah just tested it, you're right. A config like this does not work.

"overrides": [
        {
            "files": "*.html",
            "excludeFiles": "**/e0b2a5fa-157d-40b9-8333-1ab6c8876549/*.html",
            "options": { "parser": "babel" }
        },
        {
            "files": "**/e0b2a5fa-157d-40b9-8333-1ab6c8876549/*.html",
            "options": { "parser": "html" }
        }
    ]

@JoernBerkefeld
Copy link
Contributor

From my POV that's not bad though as you would expect that formatting is the same everywhere in a project folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/asset COMPONENT c/query COMPONENT c/script COMPONENT chore Jira issue-type "Task"
Projects
None yet
2 participants