djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
664 stars 81 forks source link

[BUG] [Formatter] Conflict with prettier #835

Closed Lithimlin closed 3 months ago

Lithimlin commented 3 months ago

System Info

N/A

Issue

I'm using trunk check to lint and format my files. One of the formatters I use is prettier. However, it conflicts with djlint when formatting. Is it possible to turn off the formatter or make it compatible with prettier?

How To Reproduce

  1. Install trunk
  2. Enable prettier and djlint
  3. Try to format an HTML file (using trunk fmt)
monosans commented 3 months ago

Hi. We are not aiming for prettier-like formatting. As for trunk, this problem is not related to djLint, but to trunk itself. So you either need to set up trunk or create an issue in their repository.

sshishov commented 2 months ago

I also thinking that for 1 type of file, in this case *.html the auto-formatter should use only one notation and not both at the same time. In this case you cannot have a conflict.

prettier usually used for HTLM, JS, CSS and other fe-related fields format. djlint, on the other hand, is used to format jinja-like html template file with Django related context