Closed
Description
In /whitespace.js
a subprocess is launched to print out the rules in JSON and the JSON response is parsed.
If ESLint is being run with TIMING=1
, it prints how much time each rule takes, and because the linked child process invocation is forwarding the env as-is, it's json parsing will fail and the process breaks down.
Here's the patch I'm using internally. Happy to upstream if it looks good to y'all
diff --git a/whitespace.js b/whitespace.js
index dfdf95a18e69f4bba35fe53bb59bad5de3bccbf6..052a4fc2f4d56da3eadbd2cc377131529788840d 100644
--- a/whitespace.js
+++ b/whitespace.js
@@ -51,5 +51,10 @@ if (CLIEngine) {
const path = require('path');
const { execSync } = require('child_process');
- module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'))));
+ module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'), {
+ env: {
+ ...process.env,
+ TIMING: undefined,
+ }
+ })));
}
Metadata
Metadata
Assignees
Labels
No labels