Skip to content

Commit

Permalink
🆕 Fix crash in ESLint invocation with TIMING env set
Browse files Browse the repository at this point in the history
  • Loading branch information
steelbrain committed Oct 1, 2024
1 parent e6080c7 commit 210ea61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/eslint-config-airbnb-base/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
})));
}
8 changes: 7 additions & 1 deletion packages/eslint-config-airbnb/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
})));
}

0 comments on commit 210ea61

Please sign in to comment.