stylelint / jest-preset-stylelint

Common configuration options for Jest in Stylelint environments.
MIT License
14 stars 4 forks source link

Fix testing disable comment plugins by using `ignoreDisables` #36

Open DMartens opened 3 years ago

DMartens commented 3 years ago

What is the problem you're trying to solve?

I am currently writing a plugin for disable comments.

The problem are disable comments like /* stylelint disable */ as they disable all rules. As such they also disable the rule I try to test.

What solution would you like to see?

I saw #26 which would solve the issue partially but for some reason that PR is not merged. Personally I would prefer directly passing the config to getTestRule like the options so they are shared between the rules.

Another way to solve this is to always set ignoreDisables to true as no rule author should test whether the disables work.

jeddy3 commented 3 years ago

Another way to solve this is to always set ignoreDisables to true as no rule author should test whether the disables work.

This sounds viable to me. I'll label as discussion in case anyone else has thoughts.