More comprehensive property sort order error messages #1157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What do the changes you have made achieve?
This PR introduces new option for property-sort-order rule: display-mode: lines/blocks.
Display Mode"lines" (default) works as before. Display mode "blocks" tries to agregate wrongly sorted properties in longer blocks and displays one message per detected block instead of per single line. Message for block contains expected and actual order of properties in block.
There is naive algorithm used for block detection, may not support correctly some corner cases but in general should give better (or at least not worse) advices that original.
Are there any new warning messages?
Yes, introduces messages like:
"Expected order
width, display
, founddisplay, width
"instead of
"Expected
width
, founddisplay
""Expected
display
, foundwidth
"for detected blocks (single element blocks are reported as before).
Have you written tests?
Yes, single test in both scss and sass suites.
Have you included relevant documentation
Yes
Which issues does this resolve?
Closes #416
<DCO 1.1 Signed-off-by: Rafal Witczak [email protected]>