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] H006 false positive when width, height set via CSS class #821

Open
3 tasks done
OscarVanL opened this issue Mar 16, 2024 · 0 comments
Open
3 tasks done
Labels
🔍 linter 🦠 bug Something isn't working

Comments

@OscarVanL
Copy link

System Info

  • OS: e.g. ubuntu 20.04
    MacOS 14.4
  • Python Version (python --version)
    3.9.17
  • djLint Version (djlint --version)
    1.34.1
  • template language: e.g. mustache
    jinja

Issue

There is a false positive for H006: Img tag should have height and width attributes when these are set via a CSS class.

How To Reproduce

Style an image's size via a CSS tag:

<!DOCTYPE HTML>
<html lang="en">

<head>
<style type="text/css">
.logo-img {
        width: 161px;
        height: 41px;
    }
</style>
</head>

<body>
<img class="logo-img" src="{{ foo_logo }}"/>
</body>
</html>

The linter will fail with H006 incorrectly.

Contents of .djlintrc/pyproject.toml [tool.djlint]

[tool.djlint]
ignore="T002,T003,H021,H029,H030,H031"
@OscarVanL OscarVanL added 🔍 linter 🦠 bug Something isn't working labels Mar 16, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant