stylelint-webpack-plugin: 1.0.2 need to save SASS file two times in order to get rid of errors

  • Operating System: macOS Mojave 10.14.5
  • Node Version: v11.13.0
  • NPM Version: 6.10.0
  • webpack Version: 4.41.2
  • stylelint-webpack-plugin Version: 1.0.2

Expected Behavior

I am using webpack-dev-serve, new webpack.NoEmitOnErrorsPlugin() & sass-loader with this plugin, onv0.10.5 everything works fine. I just save one time of the file after I fix the SASS that errors would be gone.

Actual Behavior

When I update to v1.0.2, every time when an SCSS file has errors, I have to save the file 2 times in order to make the error go away. Basically, the error logs are duplicated for the first time and the second time.

first time log from -> sass-loder

SassError: Invalid CSS after "}": expected 1 selector or at-rule, was "html"
        on line 4 of src/_scss/_general.scss

second time log from -> stylelint-webpack-plugin

src/_scss/_general.scss
 7:3  ✖  Unknown word   CssSyntaxError

Code

Here is my setup:

    new StyleLintPlugin({
      failOnError: false,
      emitErrors: true,
      configFile: `stylelintrc.js`,
      syntax: 'scss',
      files: '*.s?(a|c)ss'
    }),

How Do We Reproduce?

Run stylelint-webpack-plugin using webpack-dev-server in watch mode.

Question, what changes on failOnError & emitErrors from the last two releases?

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

@ricardogobbosouza thank you, but that does not work for me, but remove option pluginnew webpack.NoEmitOnErrorsPlugin() it is fine for now.