-
Notifications
You must be signed in to change notification settings - Fork 2
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
djLint should not attempt to lint HTML files in non-Django projects #736
Comments
As a Django user, I agree with the proposed changes. But in this situation, you need to take into account that someone may use djLint for regular HTML or simply do not have an extension installed for the template language used. What do you think? |
I am pretty sure everyone uses prettier for that, it's the industry standard. Does anyone who isn't a Django dev even know DJlint exists? I only came across it when I was searching for something like that specifically, never heard of it before. Just my two cents! |
Would this change disable I also use prettier for HTML, but I think the user should be given the choice of which linter to use. If djlint handles plain HTML, it should be listed as an option for the language. |
"Listed" - where? There is no list you can look up. There is only one handler per file type. If Regardless, it seems pretty clear by now that the developer has no interest in this topic |
I see. I would expect more people would have 'format on save' rather than go through the tedious step of format each individual document manually. And those (few?) people can add djlint manuallyb to that list, we are not talking about preventing them from doing so, but simply not having it as default. |
right, we don't have to [choose it manually] once it's configured in the https://stackoverflow.com/a/66647648/2848528
I'm not sure this is possible if VS Code doesn't see djlint as a valid formatter for plain HTML. Only compatible formatters are listed there, and the proposed change seems to unlist plain HTML from the valid languages. |
djLint does not and has never set itself as the default formatter for any language, so it does not conflict with Prettier or anything else. Linting is enabled by default because I believe the user doesn't have to do any additional customization to enable it. I would also like to point out that linting does not conflict with any other extensions. As for the "djLint is not installed" error, we can easily fix it by adding some button like "Don't show again". What do you think? |
Dunno, to my mind a plugin for Django templates should focus on [django-html] and leave [html] alone, but what do I know. But a "Don't show again" could be useful, I guess |
Only a few projects I work on are django, and there I install djlint (locally in the project's venv) and all is well. The problem is all the other projects.
DJLint insists on trying to lint those, and it gives me the annoying toaster message every time I save a file (I don't have it installed globally, or in some of the machine I share the settings with). VSCode correctly recognise the file as HTML (not django-html). It all boils down to this setting. I think the [html] one shouldn't be there. There is a reason why the
[django-html]
association exists, it's to keep the two separate. IMHO It's up to those devs who only ever work with Django to change the file association so that all *.html files are treated as django-html. But that should be an override, not the standard. Happy to submit a PRThe text was updated successfully, but these errors were encountered: