Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-webpack-plugin failing the build despite having failOnError set to false #51

Closed
wojciechpolak opened this issue Nov 24, 2020 · 5 comments · Fixed by #72
Closed

Comments

@wojciechpolak
Copy link

wojciechpolak commented Nov 24, 2020

  • Operating System: Linux
  • Node Version: 14.15.1
  • NPM Version: 6.14.8
  • webpack Version: 4.44.2
  • eslint-webpack-plugin Version: 2.4.0

Expected Behavior

Show all ESLint errors and warnings, but do not fail the build process. Build should be successful no matter what linting errors are presented.

Actual Behavior

Despite having failOnError set to false, the build is always failing.

Code

      plugins: [
          ...
          new ESLintPlugin({
              extensions: 'ts',
              exclude: 'node_modules',
              emitError: true,
              failOnError: false,
              emitWarning: true,
              failOnWarning: false
          })
      ]

Failure:

[09:43:19] webpack built b7ea99f302259f7f4bac in 56785ms
✖ 「wdm」: Built at: 11/24/2020 9:43:19 AM

ERROR in 
/[redacted]/foobar.ts
  63:15  error  Multiple spaces found before '('              no-multi-spaces
  63:15  error  Unexpected space before function parentheses  space-before-function-paren
  63:23  error  Missing space before opening brace            space-before-blocks

✖ 3 problems (3 errors, 0 warnings)
  3 errors and 0 warnings potentially fixable with the `--fix` option.

ℹ 「wdm」: Failed to compile.

I'm also trying an alternative config and it doesn't fail, but it also doesn't show any error or warning:

          new ESLintPlugin({
             extensions: 'ts',
              exclude: 'node_modules',
              emitWarning: true,
              failOnWarning: false
          }),

Additionally, setting Webpack's noEmitOnErrors to false doesn't affect the build failure:

      optimization: {
          noEmitOnErrors: false
      }

I also must keep .eslintrc configuring rules as error and not warn for IDE reporting.

In summary, no matter what config I set, the linting errors are visible and the build is failing (unacceptable) or the build is successful, but nothing about the errors is visible, so at this point the plugin is useless in my case.

@jnardone
Copy link

jnardone commented Dec 2, 2020

Seeing the same thing - failures even with explicit failOnError: false and failOnWarning: false

@larcho
Copy link

larcho commented Dec 16, 2020

On the same bote. As a side note, using NextJS, might have something to do with it.

@theBork
Copy link

theBork commented Dec 18, 2020

Same issue with Styleguidist

@ricardogobbosouza
Copy link
Collaborator

Hi @wojciechpolak
Provide a repository to reproduce
Sorry for late response

@wictorwilen
Copy link

The issues comes down to the webpack mode parameter, when set to production it will not generate any output (that is wepback "fails"), but generates output when set to development. Here's a sample repo with a repo: https://github.com/wictorwilen/eslintplugin-build-fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants