Closed bert-mccutchen closed 7 months ago
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.
ruleMetadata
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
lintResult._postcssResult.stylelint.ruleMetadata
Added extra safe navigation to ensure that ruleMetadata is not undefined/null before attempting to access it.
🏷️ [bumpr] Next version:v1.20.1 Changes:v1.20.0...reviewdog:stylelint-ruleMetadata-safe-nav
🚀 [bumpr] Bumped! New version:v1.20.1 Changes:v1.20.0...v1.20.1
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#L74What
Added extra safe navigation to ensure that
ruleMetadata
is not undefined/null before attempting to access it.