Skip to content

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

Closed
@wojciechpolak

Description

@wojciechpolak
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions