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

[BUG] [Linter] H012 false positive #348

Closed
3 tasks done
heitorado opened this issue Aug 23, 2022 · 1 comment
Closed
3 tasks done

[BUG] [Linter] H012 false positive #348

heitorado opened this issue Aug 23, 2022 · 1 comment
Labels
🔍 linter 🦠 bug Something isn't working released

Comments

@heitorado
Copy link

System Info

  • OS: ubuntu 22.04
  • Python Version (3.10.4)
  • djLint Version (1.11.1)
  • template language: django

Issue

When using HTMX or Alpine, sometimes we write a tiny bit of code inside double quotes on HTML tag attributes. These pieces of code might include the = sign which is triggering the H012 rule.

How To Reproduce

Check that these code snippets all fall into the H012 rule but none of them should.

<button x-on:click="myVariable = {{ myObj.id }}" class="text-red-600 hover:text-red-800">

<span x-text="showSource == true ? 'Hide source' : 'Show source'"></span>

<button x-on:click="open = !open" class="flex items-center mt-2">

@heitorado heitorado added 🔍 linter 🦠 bug Something isn't working labels Aug 23, 2022
@heitorado heitorado changed the title [BUG] [Linter] False positive on H012 [BUG] [Linter] H012 false positive Aug 23, 2022
christopherpickering pushed a commit that referenced this issue Aug 24, 2022
# [1.12.0](v1.11.1...v1.12.0) (2022-08-24)

### Bug Fixes

* **h006:** prevented false positives on H006 ([215bd23](215bd23)), closes [#344](#344) [#333](#333)
* **h012:** prevent H012 from matching the contents of tags or attributes ([4480cff](4480cff)), closes [#348](#348)
* **t001:** fixed false positive on multiline template tags ([ea76672](ea76672)), closes [#350](#350)

### Features

* **h021:** allow inline styles that contain template syntax ([f1a39ed](f1a39ed)), closes [#351](#351)
* **t002:** allow variables names to be used in the {% extends tag ([a5d96e7](a5d96e7)), closes [#349](#349)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 linter 🦠 bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants