Reputation: 2017
I have implemented STYLELINT in my project.
But currently this shows error by file name.
fileone.scss
Line 10:5 expected this 'rule-xyz'
Line 15:5 expected this 'rule-abc'
Line 25:5 expected this 'rule-123'
anotherfile.scss
Line 12:5 expected this 'rule-xyz'
Line 18:5 expected this 'rule-abc'
Line 26:5 expected this 'rule-123'
Is there any way one get error sorted by broken rules instead of filename?? like below?
rule-xyz
file-one.scss Line 10:5 expected bla bla
file-two.scss Line 19:5 expected bla bla
file-three.scss Line 30:5 expected bla bla
rule-abc
file-one.scss Line 10:5 expected bla bla
file-two.scss Line 19:5 expected bla bla
file-three.scss Line 30:5 expected bla bla
I checked on their website but couldn't find any answer.
Upvotes: 0
Views: 447
Reputation: 3959
There is no built-in formatter that lists the violations grouped by rule.
There are other options, though:
stylelint "**/*.css" --formatter verbose
) produces a tally of violations for each rule.stylelint "**/*.css" --formatter json
) produces a json
output. By using external charting libraries, one can see data in graph format as well.--custom-formatter
CLI flag. So, it is possible to write your own formatter to list the violations exactly as you want.Upvotes: 3