From f6b4b66adb7e74f7cfc8334b7256d72ee850a2d4 Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Mon, 10 Apr 2023 16:18:50 -0300 Subject: [PATCH] perf: enable cache by default (#213) * perf: enable cache by default * chore: update lock file * fix: update `cacheLocation` --- README.md | 24 ++++++++++++++++++++++++ src/options.js | 2 ++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 9297212..57d826a 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,30 @@ You can pass [eslint options](https://eslint.org/docs/developer-guide/nodejs-api > > In eslint-webpack-plugin version 1 the options were passed to the now deprecated [CLIEngine](https://eslint.org/docs/developer-guide/nodejs-api#cliengine). +### `cache` + +- Type: + +```ts +type cache = boolean; +``` + +- Default: `true` + +The cache is enabled by default to decrease execution time. + +### `cacheLocation` + +- Type: + +```ts +type cacheLocation = string; +``` + +- Default: `node_modules/.cache/eslint-webpack-plugin/.eslintcache` + +Specify the path to the cache location. Can be a file or a directory. + ### `context` - Type: diff --git a/src/options.js b/src/options.js index aac1d1b..4d1fce6 100644 --- a/src/options.js +++ b/src/options.js @@ -47,6 +47,8 @@ const schema = require('./options.json'); */ function getOptions(pluginOptions) { const options = { + cache: true, + cacheLocation: 'node_modules/.cache/eslint-webpack-plugin/.eslintcache', extensions: 'js', emitError: true, emitWarning: true,