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

Comment to disable/ignore rules #1227

Open
DerZyklop opened this issue Nov 8, 2022 · 3 comments
Open

Comment to disable/ignore rules #1227

DerZyklop opened this issue Nov 8, 2022 · 3 comments
Labels
feature request Functionality that introduces a new feature help wanted We are looking for community help keep-unstale The issue will not be marked as stale by the stale-bot

Comments

@DerZyklop
Copy link

DerZyklop commented Nov 8, 2022

Is your feature request related to a problem? Please describe.
I have a existing project, i want to enable HTMLHint, but i can not, because i would have to solve every existing error in legacy code.
I would like to not change legacy code but enable HTMLHint on the project.
So, I would like to disable/ignore some rules on some lines/files.

Describe the solution you'd like
It’s common for several linters to have the possibility to disable specific rules for specific lines, or at least disable the linter for a bunch of lines.

Here is an example of how this looks like at ESLint: https://eslint.org/docs/latest/user-guide/configuring/rules#disabling-rules

Proposal

This disables HTMLHint for the following lines:

<!-- htmlhint-disable -->
<div class="foo">Lorem</div>
<div class="bar">Ipsum</div>

This disables HTMLHint for the line with the div.foo:

<!-- htmlhint-disable-next-line -->
<div class="foo">Lorem</div>
<div class="bar">Ipsum</div>

This disables the HTMLHint rule attr-lowercase for the following lines:

<!-- htmlhint-disable attr-lowercase -->
<div CLASS="foo">Lorem</div>
<div CLASS="bar">Ipsum</div>

This disables the HTMLHint rule attr-lowercase for the line with the div.foo:

<!-- htmlhint-disable-next-line attr-lowercase -->
<div CLASS="foo">Lorem</div>
<div class="bar">Ipsum</div>

This is how you can disable it for several lines:

<!-- htmlhint-disable -->
<div class="foo1">Lorem</div>
<div class="foo2">Lorem</div>
<!-- htmlhint-enable -->
<div class="bar">Ipsum</div>

Describe alternatives you've considered

Additional context
There are related issues about that, that have been closed. I believe they have not been closed because this is feature not important, but because before 2020 this project was pretty much dead and the owner was unreachable. So this makes it necessary for me to open this topic again.

@coliff coliff added feature request Functionality that introduces a new feature keep-unstale The issue will not be marked as stale by the stale-bot labels Nov 8, 2022
@visz01
Copy link

visz01 commented Dec 1, 2022

This feature would be extremely useful!

@barmatz
Copy link

barmatz commented Mar 9, 2023

Any update on this?

@coliff coliff added the help wanted We are looking for community help label Mar 15, 2023
@greenandlonely
Copy link

Has there been any progress on this? A very useful feature to have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Functionality that introduces a new feature help wanted We are looking for community help keep-unstale The issue will not be marked as stale by the stale-bot
Projects
None yet
Development

No branches or pull requests

5 participants