webpack-contrib / eslint-loader

[DEPRECATED] A ESlint loader for webpack
MIT License
1.06k stars 121 forks source link

How to now fail the build on error or warning #314

Closed simkessy closed 4 years ago

simkessy commented 4 years ago

I'm trying to prevent my builds from failing despite ANY errors or warnings. I've tried this config in webpack:

      {
        enforce: 'pre',
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      },
      {
        // will compile both js and jsx files
        // 'pre' will make sure it checks linting before it's compiled
        enforce: 'pre',
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loader: 'eslint-loader',
        options: {
          configFile: path.resolve(__dirname, './.eslintrc'),
          formatter: PrettyEsLintFormatter,
          // cache: true,
          fix: false,
          emitWarning: true,
          // emitError: false,
          // failOnError: false,
          failOnWarnings: false
          // quiet: true,
        }
      },

I haven't ran prettier yet on my project so there's like 80 files which need to change and will cause the build to fail. I want the configs in before that, then I'll lint after.

ricardogobbosouza commented 4 years ago

@simkessy Please provide a repository with the issue.

onebree commented 4 years ago

@simkessy have you tried changing failOnWarnings to just failOnWarning? Turning on failOnError: false may help as well.