Skip to content

Commit b12ae55

Browse files
authored
chore(tools): use execFile instead of exec for the prettier call in lang helpers (#1442)
Detected calls to child_process from a function argument `fileName` Addresses javascript.lang.security.detect-child-process.detect-child-process
1 parent 08b7839 commit b12ae55

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/utils/lang/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
55
*/
66

7-
import { exec } from 'child_process';
7+
import { execFile } from 'child_process';
88
import * as fs from 'fs';
99
import * as path from 'path';
1010

@@ -45,7 +45,7 @@ export const readLangs = function readLangs(
4545

4646
async function prettier(fileName: string): Promise<void> {
4747
return new Promise((resolve, reject) => {
48-
exec(`prettier --write ${fileName}`, error => {
48+
execFile('prettier', ['--write', fileName], error => {
4949
if (error != null) {
5050
reject(error);
5151
return;

0 commit comments

Comments
 (0)