Skip to content

Commit 1238457

Browse files
committed
Add tilde expansion to paths on Linux platforms
1 parent b1821a0 commit 1238457

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to the "prettier-vscode" extension will be documented in thi
66

77
## [Unreleased]
88

9+
- Add tilde expansion to paths on Linux platforms
10+
911
## [12.4.0]
1012

1113
- **Security**: Fixed config resolution in untrusted workspaces to prevent JavaScript config files (`.prettierrc.js`, `prettier.config.js`, etc.) from being executed. Previously, even when workspace trust was enforced for module resolution, Prettier's config resolution could still `require()`/`import()` JS config files, allowing arbitrary code execution. Reported by Hector Ruiz Ruiz.

src/utils/workspace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export function getWorkspaceRelativePath(
77
filePath: string,
88
pathToResolve: string,
99
) {
10-
// In case the user wants to use ~/.prettierrc on Mac
10+
// In case the user wants to use ~/.prettierrc on Mac or Linux
1111
if (
12-
process.platform === "darwin" &&
12+
(process.platform === "darwin" || process.platform === "linux") &&
1313
pathToResolve.indexOf("~") === 0 &&
1414
os.homedir()
1515
) {

0 commit comments

Comments
 (0)