Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

usage with eslint-loader, warnings/errors are swallowed after successful compilation #72

Open
kelly-tock opened this issue Apr 27, 2019 · 5 comments

Comments

@kelly-tock
Copy link

kelly-tock commented Apr 27, 2019

  • Operating System: OS X
  • Node Version: 11.12.0
  • NPM Version: 6.7.0
  • webpack Version: 4.30.0
  • cache-loader Version: 3.0.0

Expected Behavior

with eslint-loader set up to not fail on errors/warnings, and if cache loader is used with babel-loader, warnings/errors should show up consistently.

  • on initial startup, should see errors/warnings
  • after stopping, then starting again, should see the same errors

Actual Behavior

with eslint-loader set up to not fail on errors/warnings, and if cache loader is used with babel-loader, warnings/errors should show up consistently.

  • on initial startup, see errors/warnings
  • after stopping, then starting again, the same errors/warnings are not shown

Code

 {
        enforce: 'pre',
        test: /\.(ts|tsx)$/,
        include: [path.join(cwd, 'src/js'), path.join(cwd, '../shared/src/js')],
        loader: 'eslint-loader',
        options: {
          configFile: path.resolve(cwd, './.eslintrc.js'),
          emitWarning: true,
          failOnWarning: false,
        },
      },
      {
        include: [path.join(cwd, 'src/js'), path.join(cwd, '../shared/src/js')],
        test: /\.(ts|tsx)$/,
        use: [
          {
            loader: 'cache-loader'
          },
          {
            loader: 'babel-loader',
            options: {
              cacheDirectory: true,
              cacheCompression: false,
              compact: false,
              babelrc: false,
              plugins: ['@babel/plugin-syntax-dynamic-import'],
              presets: ['babel-preset-tock'],
            },
          },
        ],
      },

How Do We Reproduce?

introduce a warning from linting, such as no-unused-variables, startup webpack with webpack dev server, and see the warning.
stop webpack dev server, then start again. you will not see the error.

Notes

Without cache-loader, the expected behavior above does happen. i'm not sure if the issue is with cache-loader, or with eslint-loader

webpack-contrib/eslint-loader#267

@alexander-akait
Copy link
Member

/cc @mistic

@barberdt
Copy link

barberdt commented Sep 5, 2019

Repro case provided here: webpack-contrib/eslint-loader#267 (comment).

As mentioned in that comment, not sure which package this issue truly belongs to. Happy to provide the repro information wherever needed.

Thanks for any and all support on this!

@alexander-akait
Copy link
Member

You don't need cache-loader for eslint-loader, use preLoader for eslint-loader

@barberdt
Copy link

barberdt commented Sep 5, 2019

@evilebottnawi no, but we need cache-loader for other reasons. The repro repository provided is as bare-bones as necessary to reproduce the issue. In our private corporate repository, we are using cache-loader (among many other dependencies) for a variety of other reasons.

@rvillalba-novetta
Copy link

I'm seeing similar issues with ts-loader. On first run I have errors reported, on second run it just reports success and grabs what's in the cache.

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

No branches or pull requests

4 participants