[eslint config] [*] [fix] fix crash in eslint invocation with TIMING env set

This commit is contained in:
Anees Iqbal
2024-10-02 01:14:01 +04:00
committed by Jordan Harband
parent e6080c7bee
commit f45bd1ebc0
2 changed files with 14 additions and 2 deletions

View File

@@ -51,5 +51,11 @@ if (CLIEngine) {
const path = require('path');
const { execSync } = require('child_process');
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'))));
// NOTE: ESLint adds runtime statistics to the output (so it's no longer JSON) if TIMING is set
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'), {
env: {
...process.env,
TIMING: undefined,
}
})));
}

View File

@@ -51,5 +51,11 @@ if (CLIEngine) {
const path = require('path');
const { execSync } = require('child_process');
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'))));
// NOTE: ESLint adds runtime statistics to the output (so it's no longer JSON) if TIMING is set
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'), {
env: {
...process.env,
TIMING: undefined,
}
})));
}