diff --git a/packages/cli/src/config/settings.test.ts b/packages/cli/src/config/settings.test.ts index 942c3996f8..ac8882922c 100644 --- a/packages/cli/src/config/settings.test.ts +++ b/packages/cli/src/config/settings.test.ts @@ -521,7 +521,7 @@ describe('Settings Loading and Merging', () => { }); }); - it('should ignore folderTrust from workspace settings', () => { + it('should use folderTrust from workspace settings when trusted', () => { (mockFsExistsSync as Mock).mockReturnValue(true); const userSettingsContent = { security: { @@ -533,7 +533,7 @@ describe('Settings Loading and Merging', () => { const workspaceSettingsContent = { security: { folderTrust: { - enabled: false, // This should be ignored + enabled: false, // This should be used }, }, }; @@ -554,7 +554,7 @@ describe('Settings Loading and Merging', () => { ); const settings = loadSettings(MOCK_WORKSPACE_DIR); - expect(settings.merged.security?.folderTrust?.enabled).toBe(true); // User setting should be used + expect(settings.merged.security?.folderTrust?.enabled).toBe(false); // Workspace setting should be used }); it('should use system folderTrust over user setting', () => { diff --git a/packages/cli/src/config/settings.ts b/packages/cli/src/config/settings.ts index 2194d2240c..33a9b71856 100644 --- a/packages/cli/src/config/settings.ts +++ b/packages/cli/src/config/settings.ts @@ -329,18 +329,6 @@ function mergeSettings( ): Settings { const safeWorkspace = isTrusted ? workspace : ({} as Settings); - // folderTrust is not supported at workspace level. - const { security, ...restOfWorkspace } = safeWorkspace; - const safeWorkspaceWithoutFolderTrust = security - ? { - ...restOfWorkspace, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - security: (({ folderTrust, ...rest }) => rest)(security), - } - : { - ...restOfWorkspace, - }; - // Settings are merged with the following precedence (last one wins for // single values): // 1. System Defaults @@ -352,7 +340,7 @@ function mergeSettings( {}, // Start with an empty object systemDefaults, user, - safeWorkspaceWithoutFolderTrust, + safeWorkspace, system, ) as Settings; }