postcss / gulp-postcss

Pipe CSS through PostCSS processors with a single parse
MIT License
769 stars 65 forks source link

I need a way to read messages of postcss #105

Closed gucong3000 closed 7 years ago

gucong3000 commented 7 years ago

In my case, I need to read messages of gulp plugin, and show them in GUI.

I write a module, to read messages of gulp-eslint or gulp-jshint, both of them are have way to read output.

That is code from gulp-eslint, it is output result as file.eslint:

        file.eslint = verify(file.contents.toString(), filePath);

https://github.com/adametry/gulp-eslint/blob/master/index.js#L70

That is code from gulp-jshint, it is output result as file.jshint:

      // get or create file.jshint, we will write all output here
      var out = file.jshint || (file.jshint = {});

https://github.com/spalger/gulp-jshint/blob/master/src/lint.js#L90

That is what I want: #106

gucong3000 commented 7 years ago

gulp-babel uses a similar strategy:

file.babel = res.metadata;

https://github.com/babel/gulp-babel/blob/master/index.js#L49

w0rm commented 7 years ago

I am against of adding anything into the gulp file object, because the file may be shared between multiple plugins and each plugin won't keep this info up to date.

sourcemaps is the exception, and there are so many issues with it.

If you need to read messages from postcss, you can create your own reporter plugin for postcss.

gucong3000 commented 7 years ago

These gulp plugins have interfaces to get messages. I really need this interface like them.

gulp-csslint eclint gulp-eslint gulp-htmlhint gulp-jscs gulp-jshint gulp-tslint

I will use it in my plugin gulp-reporter Please reconsider my request