stylelint / jest-preset-stylelint

Common configuration options for Jest in Stylelint environments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for custom unfixable error messages

AndyOGo opened this issue · comments

What is the problem you're trying to solve?

My plugin supports to customize unfixable error messages.

But testing them with always fails

{
  fix: true,
  reject: [{
    unfixable: true,
    message: "This message passes first assertion, but alwys fail the one below",
  }]

What solution would you like to see?

Would it make sense to assert following only if unfixable is falsy?

// Checks whether only errors other than those fixed are reported
const outputAfterLintOnFixedCode = await lint({
...stylelintOptions,
code: fixedCode,
});
expect(outputAfterLintOnFixedCode.results[0]).toMatchObject({
warnings: outputAfterFix.results[0].warnings,
parseErrors: [],
});