Skip to content

Commit f45bd1e

Browse files
steelbrainljharb
authored andcommittedOct 1, 2024
[eslint config] [*] [fix] fix crash in eslint invocation with TIMING env set
1 parent e6080c7 commit f45bd1e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
 

‎packages/eslint-config-airbnb-base/whitespace.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,11 @@ if (CLIEngine) {
5151
const path = require('path');
5252
const { execSync } = require('child_process');
5353

54-
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'))));
54+
// NOTE: ESLint adds runtime statistics to the output (so it's no longer JSON) if TIMING is set
55+
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'), {
56+
env: {
57+
...process.env,
58+
TIMING: undefined,
59+
}
60+
})));
5561
}

‎packages/eslint-config-airbnb/whitespace.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,11 @@ if (CLIEngine) {
5151
const path = require('path');
5252
const { execSync } = require('child_process');
5353

54-
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'))));
54+
// NOTE: ESLint adds runtime statistics to the output (so it's no longer JSON) if TIMING is set
55+
module.exports = JSON.parse(String(execSync(path.join(__dirname, 'whitespace-async.js'), {
56+
env: {
57+
...process.env,
58+
TIMING: undefined,
59+
}
60+
})));
5561
}

0 commit comments

Comments
 (0)
Failed to load comments.