From 45d645c4ea00f7d146d7816acb311fc5edf6e034 Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Tue, 21 Mar 2023 19:22:37 -0300 Subject: [PATCH 1/3] perf: enable cache by default --- README.md | 24 ++++++++++++++++++++++++ src/options.js | 2 ++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 9297212..aa2374b 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/.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..ffe183d 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/.eslintcache', extensions: 'js', emitError: true, emitWarning: true, From 4911d1a0834ddd59a731bf86378045ded61200f2 Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Tue, 21 Mar 2023 19:34:02 -0300 Subject: [PATCH 2/3] chore: update lock file --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56f1915..59d8092 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13121,9 +13121,9 @@ "dev": true }, "node_modules/webpack": { - "version": "5.75.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz", - "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==", + "version": "5.76.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz", + "integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -23307,9 +23307,9 @@ "dev": true }, "webpack": { - "version": "5.75.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz", - "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==", + "version": "5.76.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz", + "integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", From 29420e0dc0447ae44883d004a304d73decdbf0ac Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Mon, 10 Apr 2023 14:59:10 -0300 Subject: [PATCH 3/3] fix: update `cacheLocation` --- README.md | 2 +- src/options.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa2374b..57d826a 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ The cache is enabled by default to decrease execution time. type cacheLocation = string; ``` -- Default: `node_modules/.cache/.eslintcache` +- Default: `node_modules/.cache/eslint-webpack-plugin/.eslintcache` Specify the path to the cache location. Can be a file or a directory. diff --git a/src/options.js b/src/options.js index ffe183d..4d1fce6 100644 --- a/src/options.js +++ b/src/options.js @@ -48,7 +48,7 @@ const schema = require('./options.json'); function getOptions(pluginOptions) { const options = { cache: true, - cacheLocation: 'node_modules/.cache/.eslintcache', + cacheLocation: 'node_modules/.cache/eslint-webpack-plugin/.eslintcache', extensions: 'js', emitError: true, emitWarning: true,