Skip to content
Advertisement

With eslint-webpack-plugin@2.4.1, how do you use eslint’s cache?

After switching from eslint-loader, our initial watch builds have slowed down substantially due to the lack of caching. Is there a way to use eslint’s cache?

Advertisement

Answer

ESLint’s node api has cache and cacheLocation keys in it, and setting those like

const ESLintPlugin = require('eslint-webpack-plugin')

module.exports = {
  plugins: [
    new ESLintPlugin({
      cache: true, 
      cacheLocation
    })
  ]
}

enables caching like eslint-webpack-loader‘s old caching behavior.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement