Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "prettier-vscode" extension will be documented in thi

## [Unreleased]

- Add tilde expansion to paths on Linux platforms

## [12.4.0]

- **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.
Expand Down
4 changes: 2 additions & 2 deletions src/utils/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export function getWorkspaceRelativePath(
filePath: string,
pathToResolve: string,
) {
// In case the user wants to use ~/.prettierrc on Mac
// In case the user wants to use ~/.prettierrc on Mac or Linux
if (
process.platform === "darwin" &&
(process.platform === "darwin" || process.platform === "linux") &&
pathToResolve.indexOf("~") === 0 &&
os.homedir()
) {
Expand Down