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

Use relevant .prettierrc from each project #38

Open
snoblenet opened this issue Nov 23, 2022 · 3 comments
Open

Use relevant .prettierrc from each project #38

snoblenet opened this issue Nov 23, 2022 · 3 comments

Comments

@snoblenet
Copy link

If I had control over the formatting settings on all the projects I work on, I'd give them all the same settings and copy those settings to the prettier section in dprint.json.

(Or even just use dprint's native formatting.)

However, I don't.

How can I ensure that dprint-plugin-prettier always uses the specific .prettierrc file that is relevant to whatever file that it is formatting at the time?

@adambullmer
Copy link

adambullmer commented Nov 17, 2023

100% would love to see support for prettier's internal config loading system. But shy of implementing all the various loaders, being able to specify a config file path would also be a win. We have shared settings for prettier, and copy+paste the config in every repo rather than a reference to the shared config would be a step backwards for the config reuse.

@sschneider-ihre-pvs
Copy link

done the same. would be great if there would be a relative path option or so or something like, the neareast prettier config relative to the file that is going to be formatted.

@basaran
Copy link

basaran commented Jun 7, 2024

This would be nice feature indeed, and can be used as a stepping stone to migrate away from local project installation of prettier, especially when there is now an NPM package for dprint.

One workflow could be:

  • look for prettier config files in the project root (there are a few...)
  • read them in precedence order (I can put together a list)
  • override with the config from the dprint.json (if any)
  • then execute prettier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants