File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,13 +14,30 @@ async function main() {
1414 console . log ( report ) ;
1515 }
1616
17- // Stylelint leaves `errored` set on results whose problems were all suppressed, so count what remains.
18- const hasErrors = results . some ( ( result ) =>
19- result . parseErrors . length > 0 ||
20- result . invalidOptionWarnings . length > 0 ||
17+ // Don't rely on `errored`: Stylelint leaves it set on results whose problems were all suppressed. Count what remains.
18+ const hasViolations = results . some ( ( result ) =>
2119 result . warnings . some ( ( warning ) => warning . severity === 'error' )
2220 ) ;
2321
22+ const hasErrors = hasViolations || results . some ( ( result ) =>
23+ result . parseErrors . length > 0 ||
24+ result . invalidOptionWarnings . length > 0
25+ ) ;
26+
27+ if ( hasViolations ) {
28+ console . log (
29+ [
30+ 'Stylelint found new CSS Coding Standards violations.' ,
31+ '' ,
32+ 'Existing violations are allowed up to the count recorded for each file and rule in stylelint-suppressions.json.' ,
33+ 'Note that if a file has new violations, Stylelint lists all of them, including the existing ones.' ,
34+ '' ,
35+ 'Fix the problems you introduced. Do not increase the counts in stylelint-suppressions.json.' ,
36+ 'Once you have fixed the new violations, update the suppressions file by using: npm run lint:css:update-suppressions' ,
37+ ] . join ( '\n' )
38+ ) ;
39+ }
40+
2441 process . exitCode = hasErrors ? 1 : 0 ;
2542}
2643
You can’t perform that action at this time.
0 commit comments