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

Fix inconsistent errored properties in stylelint.lint() return value #6982

Closed
dvun0g opened this issue Jun 26, 2023 · 3 comments · Fixed by #6983
Closed

Fix inconsistent errored properties in stylelint.lint() return value #6982

dvun0g opened this issue Jun 26, 2023 · 3 comments · Fixed by #6983
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@dvun0g
Copy link

dvun0g commented Jun 26, 2023

What steps are needed to reproduce the bug?

  1. Enable option reportNeedlessDisables.
  2. Create an unused disable comment.
  3. Start stylelint.lint.
  4. Look at results.source.errored.

I leave a link to the repository where I reproduced the error: https://github.com/dvun0g/issue-stylelint-reportNeedlessDisables-not-error-source.

Description:
When running stylelint.list, if the file contains only reportNeedlessDisables errors, the errored field will be false. You can clearly see in https://github.com/dvun0g/issue-stylelint-reportNeedlessDisables-not-error-source/blob/trunk/results.stylelint.json.

What Stylelint configuration is needed to reproduce the bug?

Any, i used this

{
	"extends": "stylelint-config-standard"
}

How did you run Stylelint?

Start stylelint using the Node JS API stylelint.lint.

Which version of Stylelint or dependencies are you using?

{
     "stylelint": "^15.9.0",
     "stylelint-config-standard": "^33.0.0"
}

What did you expect to happen?

It was expected that the errored field would be set to true, if there are reportNeedlessDisables errors in the file.

What actually happened?

Field errored equal false.

Does the bug relate to non-standard syntax?

No, I use css.

Proposal to fix the bug

No response

@ybiquitous ybiquitous added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule labels Jun 26, 2023
@ybiquitous
Copy link
Member

@dvun0g Thanks a lot for the report with a reproducible repository! I can confirm the bug. 👍🏼

I've labeled the issue as ready to implement. Please consider contributing if you have time.

Also, I'll dig into this bug.

@ybiquitous
Copy link
Member

I found that the same problem occurs in the case of reportDescriptionlessDisables.

@ybiquitous ybiquitous changed the title Bug: reportNeedlessDisables does not cause an error when using the stylelint API in Node JS. Fix inconsistent errored properties in stylelint.lint() return value Jun 26, 2023
@ybiquitous
Copy link
Member

I found out the reason. I'm preparing PR.

@ybiquitous ybiquitous added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule
Development

Successfully merging a pull request may close this issue.

2 participants