@html-validate/prettier-config 3.0.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const path = require("path");
4
- const { spawn } = require("child_process"); // eslint-disable-line security/detect-child-process
4
+ const { spawn } = require("child_process");
5
5
 
6
6
  const pkgPath = path.dirname(require.resolve("lint-staged/package.json"));
7
7
  const binary = path.join(pkgPath, "bin/lint-staged.js");
8
8
 
9
+ /* eslint-disable-next-line sonarjs/no-os-command-from-path -- as is */
9
10
  spawn("node", [binary, ...process.argv.slice(2)], {
10
11
  stdio: "inherit",
11
12
  }).on("exit", (code) => {
12
- /* eslint-disable-next-line no-process-exit */
13
- process.exit(code);
13
+ process.exitCode = code;
14
14
  });
package/bin/prettier.js CHANGED
@@ -1,22 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require("node:fs");
4
3
  const path = require("node:path");
5
- const { spawn } = require("child_process"); // eslint-disable-line security/detect-child-process
4
+ const { spawn } = require("child_process");
6
5
 
7
6
  const pkgPath = path.dirname(require.resolve("prettier/package.json"));
8
- const binary = [
9
- path.join(pkgPath, "bin/prettier.cjs"), // prettier 3.x
10
- path.join(pkgPath, "bin-prettier.js"), // prettier 2.x
11
- ].find((it) => fs.existsSync(it));
7
+ const binary = path.join(pkgPath, "bin/prettier.cjs");
12
8
 
13
9
  if (!binary) {
14
10
  throw new Error("Failed to locate prettier executable");
15
11
  }
16
12
 
13
+ /* eslint-disable-next-line sonarjs/no-os-command-from-path -- as is */
17
14
  spawn("node", [binary, ...process.argv.slice(2)], {
18
15
  stdio: "inherit",
19
16
  }).on("exit", (code) => {
20
- /* eslint-disable-next-line no-process-exit */
21
- process.exit(code);
17
+ process.exitCode = code;
22
18
  });