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 #6983

Merged
merged 1 commit into from Jun 27, 2023

Conversation

ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented Jun 26, 2023

Which issue, if any, is this issue related to?

Closes #6982

Is there anything in the PR that needs further explanation?

This pull request fixes the errored property calculation in prepareReturnValue().


Internal details:

standalone() just returns a return value from prepareReturnValue(). This value includes a correct errored property.

stylelint/lib/standalone.js

Lines 268 to 272 in 9ddba42

const result = prepareReturnValue(stylelintResults, maxWarnings, formatterFunction, cwd);
debug(`Linting complete in ${Date.now() - startTime}ms`);
return result;

/** @type {LinterResult} */
const returnValue = {
cwd,
errored,
results: [],
output: '',
reportedDisables: [],
ruleMetadata: getRuleMetadata(stylelintResults),
};

Before this pull request's change, returnValue.errored could differ from returnValue.results[*].errored.

returnValue.results = stylelintResults;

@changeset-bot
Copy link

changeset-bot bot commented Jun 26, 2023

🦋 Changeset detected

Latest commit: 9ddba42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ybiquitous ybiquitous marked this pull request as ready for review June 26, 2023 14:03
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for discovering the cause.

LGTM!

@ybiquitous ybiquitous merged commit bdec351 into main Jun 27, 2023
18 checks passed
@ybiquitous ybiquitous deleted the issue-6982 branch June 27, 2023 00:15
@jeddy3 jeddy3 mentioned this pull request Jul 3, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix inconsistent errored properties in stylelint.lint() return value
2 participants