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

Document precedence in the README #58

Open
kwangure opened this issue Aug 23, 2023 · 1 comment
Open

Document precedence in the README #58

kwangure opened this issue Aug 23, 2023 · 1 comment

Comments

@kwangure
Copy link

This is a follow up for #11. Even with the "why this plugin exists" section in the README, my working assumption (like the OP in #11) was:

dprint will format most files, but prettier will format the files that dprint doesn't support (e.g: svelte)

The note on precedence in the plugin docs is helpful, but I read it separated with time from when I was using this plugin and didn't immediately put two and two together.

Even if I'm not using plugins that overlap in functionality, it's insightful to just know the soup to nuts of how Dprint works. I think the quote in #11 captures that:

Dprint's CLI has no clue about how to format any kind of file. The plugins do that. So if you use the prettier plugin then it will format using prettier. If you use another plugin like dprint-plugin-typescript in addition to dprint-plugin-prettier, then you can get it formatting JavaScript and TypeScript code with dprint-plugin-typescript by putting the url for dprint-plugin-typescript before dprint-plugin-prettier's url in the plugins array of the configuration file.

I'd consider including a version of this quote not only in this plugin, but also in the main Dprint README.

@kwangure
Copy link
Author

As a tangetially related question, then how does a plugin prettier-plugin-jsdoc operate on JS files (but the built-in JS prettier does not when preceeded by dprint-plugin-typescript)? Associations?

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

1 participant