Skip to content

Commit

Permalink
[eslint config] [*] [fix] fix crash in eslint invocation with TIMING …
Browse files Browse the repository at this point in the history
…env set
  • Loading branch information
steelbrain authored and ljharb committed Oct 1, 2024
1 parent e6080c7 commit f45bd1e
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 f45bd1e

Please sign in to comment.