reviewdog / action-stylelint

Run stylelint with reviewdog
https://github.com/marketplace?type=actions&query=reviewdog
MIT License
46 stars 24 forks source link

Stylelint Formatter: ruleMetadata Safe Navigation #113

Closed bert-mccutchen closed 7 months ago

bert-mccutchen commented 7 months ago

Why?

Solves issue https://github.com/reviewdog/action-stylelint/issues/112

I had predicted that a rule may not exist in the rule metadata. However, I did not predict that the entire ruleMetadata object could be undefined when referencing the Stylelint custom formatter documentation.

I believe this to actually be a bug from the Stylelint source, where it is not handling a potentially undefined result when accessing lintResult._postcssResult.stylelint.ruleMetadata: https://github.com/stylelint/stylelint/blob/15.11.0/lib/prepareReturnValue.js#L74

What

Added extra safe navigation to ensure that ruleMetadata is not undefined/null before attempting to access it.

github-actions[bot] commented 7 months ago

🏷️ [bumpr] Next version:v1.20.1 Changes:v1.20.0...reviewdog:stylelint-ruleMetadata-safe-nav

github-actions[bot] commented 7 months ago

🚀 [bumpr] Bumped! New version:v1.20.1 Changes:v1.20.0...v1.20.1