@scalvert/stylelint-formatter-sonarqube
A custom formatter for
stylelint
that will format the output in SonarQube's generic issue format.
Install
npm i @scalvert/stylelint-formatter-sonarqube --save-dev
# or
yarn add @scalvert/stylelint-formatter-sonarqube --dev
Output will be in 'Generic Issue Format'.
{
"issues": [
{
"engineId": "stylelint",
"ruleId": "property-no-unknown",
"primaryLocation": {
"message": "Unexpected unknown property \"foo\" (property-no-unknown)",
"filePath": "foo.css",
"textRange": {
"startLine": 1,
"startColumn": 17,
"endLine": 1,
"endColumn": 17
}
}
},
{
"engineId": "stylelint",
"ruleId": "block-no-empty",
"primaryLocation": {
"message": "Unexpected empty block (block-no-empty)",
"filePath": "sub/bar.css",
"textRange": {
"startLine": 1,
"startColumn": 5,
"endLine": 1,
"endColumn": 5
}
}
}
]
}
Usage
stylelint "**/*.css" --custom-formater node_modules/@scalvert/stylelint-formatter-sonarqube