Adding --no-color flag to stylelint args (#5050)

* Adding --no-color flag to sass stylelint

* Adding --no-color to all stylelint args

* Adding --no-color expectation to stylelint tests

* Properly handling SyntaxError for stylelint; adding corresponding test

* Fixing CSS stylelint parameters and adding regression test
This commit is contained in:
Steve Matney
2025-11-22 05:00:41 -07:00
committed by GitHub
parent b9d7f56471
commit de2d3da738
16 changed files with 79 additions and 23 deletions

View File

@@ -41,3 +41,26 @@ Execute (stylelint should complain when no configuration file is used):
\ 'detail': join(g:error_lines, "\n"),
\ }],
\ ale#handlers#css#HandleStyleLintFormat(347, g:error_lines[:])
Execute (stylelint should complain but not blow up when SyntaxError is encountered):
let g:error_lines = [
\ 'SyntaxError: Unexpected token, expected "," (136:4)',
\ ' at constructor (/home/ts-project/node_modules/@babel/parser/lib/index.js:367:19)',
\ ' at TypeScriptParserMixin.raise (/home/ts-project/node_modules/@babel/parser/lib/index.js:6630:19)',
\ ' at TypeScriptParserMixin.unexpected (/home/ts-project/node_modules/@babel/parser/lib/index.js:6650:16)',
\ ' at TypeScriptParserMixin.expect (/home/ts-project/node_modules/@babel/parser/lib/index.js:6930:12)',
\ ' at TypeScriptParserMixin.tsParseDelimitedListWorker (/home/ts-project/node_modules/@babel/parser/lib/index.js:7932:14)',
\ ' at TypeScriptParserMixin.tsParseDelimitedList (/home/ts-project/node_modules/@babel/parser/lib/index.js:7909:25)',
\ ' at /home/ts-project/node_modules/@babel/parser/lib/index.js:9170:19',
\ ' at TypeScriptParserMixin.tsInTopLevelContext (/home/ts-project/node_modules/@babel/parser/lib/index.js:8834:14)',
\ ' at /home/ts-project/node_modules/@babel/parser/lib/index.js:9168:44',
\ ' at TypeScriptParserMixin.tsInType (/home/ts-project/node_modules/@babel/parser/lib/index.js:8841:14)',
\]
AssertEqual
\ [{
\ 'lnum': 1,
\ 'text': 'stylelint exception thrown (type :ALEDetail for more information)',
\ 'detail': join(g:error_lines, "\n"),
\ }],
\ ale#handlers#css#HandleStyleLintFormat(347, g:error_lines[:])