Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions packages/eslint-config-airbnb-base/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ if (CLIEngine) {
const { execSync } = require('child_process');

// 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,
}
})));
try {
const output = execSync(path.join(__dirname, 'whitespace-async.js'), {
env: {
...process.env,
TIMING: undefined,
},
});
module.exports = JSON.parse(String(output));
} catch (err) {
throw new Error(`Failed to load whitespace config via whitespace-async.js: ${err.message}`, { cause: err });
}
}
17 changes: 11 additions & 6 deletions packages/eslint-config-airbnb/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ if (CLIEngine) {
const { execSync } = require('child_process');

// 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,
}
})));
try {
const output = execSync(path.join(__dirname, 'whitespace-async.js'), {
env: {
...process.env,
TIMING: undefined,
},
});
module.exports = JSON.parse(String(output));
} catch (err) {
throw new Error(`Failed to load whitespace config via whitespace-async.js: ${err.message}`, { cause: err });
}
}
Loading