developer-stylechain / gulp-stylelint

Gulp plugin for running Stylelint results through various reporters.
MIT License
14 stars 4 forks source link

"verbose" formatter does not work when called via this plugin #9

Open andmor- opened 9 months ago

andmor- commented 9 months ago

The following gulp pipe fails:

      gulpStylelint({
        failAfterError: true,
        fix: hasFixFlag(),
        reporters: [{ formatter: "verbose", console: true }]
      })

With the following debug output:

user@host ~$ gulp lintscss
[17:18:13] Using gulpfile ~/gulpfile.js
[17:18:13] Starting 'lintscss'...
[17:18:14] 'lintscss' errored after 783 ms
[17:18:14] TypeError in plugin "gulp-stylelint"
Message:
    Cannot read properties of undefined (reading 'ruleMetadata')
Stack:
TypeError: Cannot read properties of undefined (reading 'ruleMetadata')
    at printProblems (~/node_modules/stylelint/lib/formatters/verboseFormatter.js:72:33)
    at verboseFormatter (~/node_modules/stylelint/lib/formatters/verboseFormatter.js:92:3)
    at Object.apply ~/node_modules/import-lazy/index.js:16:20)
    at reporter (~/node_modules/@ronilaukkarinen/gulp-stylelint/src/reporter-factory.js:45:27)
    at ~/node_modules/@ronilaukkarinen/gulp-stylelint/src/index.js:132:38
    at Array.map (<anonymous>)
    at passLintResultsThroughReporters (~/node_modules/@ronilaukkarinen/gulp-stylelint/src/index.js:132:22)

npx stylelint -f "verbose" <filename> works fine.

mh-nichts commented 7 months ago

I reported the same issue on @olegskl/gulp-stylelint : https://github.com/olegskl/gulp-stylelint/issues/143

The error is the same when using "github" formatter, but when using other formatters (ex : "string") everything works well.

It seems that it's linked to some new functionalities of Stylelint : https://github.com/stylelint/stylelint/pull/6166 So using an older version of Stylelint (ex : 14.9) is OK, but it breaks from 14.10.