From c0feb58314a6f2f259a2e0b755115e1db8d6224d Mon Sep 17 00:00:00 2001 From: Rafael Santana Date: Tue, 1 Jun 2021 18:25:45 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#53485=20[eslint]?= =?UTF-8?q?=20add=20`cacheStategy`=20option=20by=20@rafaelss95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [eslint] add `cacheStategy` option * [eslint] add tests for `cacheStrategy` option * fixup! [eslint] add cacheStategy option --- types/eslint/eslint-tests.ts | 2 ++ types/eslint/index.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index cc59b80907179d..08b71375ce100a 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -633,6 +633,7 @@ eslint = new ESLint({ overrideConfig: {} }); eslint = new ESLint({ overrideConfigFile: "foo" }); eslint = new ESLint({ cache: true }); eslint = new ESLint({ cacheLocation: "foo" }); +eslint = new ESLint({ cacheStrategy: "content" }); eslint = new ESLint({ cwd: "foo" }); eslint = new ESLint({ errorOnUnmatchedPattern: true }); eslint = new ESLint({ extensions: ["js"] }); @@ -734,6 +735,7 @@ cli = new CLIEngine({ baseConfig: false }); cli = new CLIEngine({ baseConfig: { extends: ["lynt"] } }); cli = new CLIEngine({ cache: true }); cli = new CLIEngine({ cacheFile: "foo" }); +cli = new CLIEngine({ cacheStrategy: "content" }); cli = new CLIEngine({ configFile: "foo" }); cli = new CLIEngine({ cwd: "foo" }); cli = new CLIEngine({ envs: ["browser"] }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index d3140186fc00b8..c3d2bcecd57936 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -842,6 +842,7 @@ export namespace ESLint { // Cache-related cache?: boolean; cacheLocation?: string; + cacheStrategy?: "content" | "metadata"; } interface LintResult { @@ -916,6 +917,7 @@ export namespace CLIEngine { cache?: boolean; cacheFile?: string; cacheLocation?: string; + cacheStrategy?: "content" | "metadata"; configFile?: string; cwd?: string; envs?: string[];