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

Add an option to ignore all issues which are not auto-fixeable with stylelint-disable-next-line [list of rules] comment #5757

Open
bondom opened this issue Dec 2, 2021 · 3 comments
Labels
status: needs discussion triage needs further discussion

Comments

@bondom
Copy link

bondom commented Dec 2, 2021

What is the problem you're trying to solve?

Migrating old codebase to stylelint without turning off stylelint rules.

Of course, there are some other solutions for this problem like disabling stylelint for all old files and gradually migrating them. But I think that such disable comments together with some /TODO: get rid of this disable comment/ comment is more useful, because every developer that will work on some piece of the functionality will explicitly see that he needs to reformat this piece of the code. It is especially useful for hude codebases with a lot of devs.

What solution would you like to see?

New option, that can be applied when fixing stylelint issues, that will add disable comment for all lines with problems.
Example of using:
stylelint 'src/**/*.scss' --syntax scss --fix --disable-unresolved
Original code:

 ...
 .my-class {}
 ...

Code after modification:

...
 // TODO: get rid of disable comment next time when editing
 /* stylelint-disable-next-line rule1, rule2 */
 .my-class {}
...
@ybiquitous
Copy link
Member

@bondom Thanks for using the template. The suggestion looks good to me. 👍🏼

I remember there was a 3rd-party ESLint plugin that did something similar, but I've forgotten the name. 😅

@ybiquitous ybiquitous added status: needs discussion triage needs further discussion type: enhancement a new feature that isn't related to rules labels Dec 2, 2021
@jeddy3 jeddy3 removed the type: enhancement a new feature that isn't related to rules label Feb 10, 2022
@ybiquitous
Copy link
Member

Um, I don't remember, sorry. 😓

But, if someone published a plugin for this feature, we could evaluate whether we should bring it to the Stylelint core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion triage needs further discussion
Development

No branches or pull requests

4 participants