From 8553b076092d9470dd248d6d513da5bac6db851a Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Mon, 15 Mar 2021 16:03:34 +0100 Subject: [PATCH] Fixes #1203: Using `eslint.nodePath` globally rather than locally, yet on every new window: `The eslint.nodePath setting requires user confirmation. To do so execute the Select Node Path command.` --- CHANGELOG.md | 4 ++++ client/src/extension.ts | 7 ++++--- package.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe26d776..a305a66f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 2.1.19 + +- fixe [Using `eslint.nodePath` globally rather than locally, yet on every new window: `The eslint.nodePath setting requires user confirmation. To do so execute the Select Node Path command.`](https://github.com/microsoft/vscode-eslint/issues/1203) + ### 2.1.18 - warn about nodePath values being defined separately in the workspace folder although a multi workspace folder setup is open. diff --git a/client/src/extension.ts b/client/src/extension.ts index 7a434841..a103876b 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -1312,9 +1312,10 @@ function realActivate(context: ExtensionContext): void { } else { // The setting is not confirmed. So always take the global value. value = (inspect.globalValue ?? inspect.defaultValue ?? undefined) as (T | undefined | null); - // If confirmedSettings is undefined we need to check whether there was a value local that is different from the - // global value. If so still take the global value but let the user know that he can confirm a local value. - if (confirmedSettings === undefined && (inspect.workspaceValue !== value || inspect.workspaceFolderValue !== value)) { + // If confirmedSettings is undefined we need to check whether there was a value local either as a workspace or + // workspace folder value. It is enough to check for undefined since values not in scope default to undefined (e.g. + // the folder value is undefined if a workspace is open). + if (confirmedSettings === undefined && (inspect.workspaceValue !== undefined || inspect.workspaceFolderValue !== undefined)) { confirm = true; } } diff --git a/package.json b/package.json index 7a4dadab..d76d8943 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-eslint", "displayName": "ESLint", "description": "Integrates ESLint JavaScript into VS Code.", - "version": "2.1.18", + "version": "2.1.19", "author": "Microsoft Corporation", "license": "MIT", "repository": {