diff --git a/.vscode/.gitignore b/.vscode/.gitignore new file mode 100644 index 0000000000..161fdfa6b8 --- /dev/null +++ b/.vscode/.gitignore @@ -0,0 +1,2 @@ +# GitShift personal account configuration +github-accounts.json diff --git a/packages/eslint-config-airbnb-base/whitespace-async.js b/packages/eslint-config-airbnb-base/whitespace-async.js index 06f4f89075..f5745b78bb 100755 --- a/packages/eslint-config-airbnb-base/whitespace-async.js +++ b/packages/eslint-config-airbnb-base/whitespace-async.js @@ -46,4 +46,7 @@ async function onlyErrorOnRules(rulesToError, config) { return errorsOnly; } -onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))); +onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))).catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/packages/eslint-config-airbnb-base/whitespace.js b/packages/eslint-config-airbnb-base/whitespace.js index 01e5198671..0415d31616 100644 --- a/packages/eslint-config-airbnb-base/whitespace.js +++ b/packages/eslint-config-airbnb-base/whitespace.js @@ -51,11 +51,16 @@ if (CLIEngine) { const path = require('path'); 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 { + // 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, + } + }))); + } catch (error) { + console.error('Error loading whitespace config:', error.message); + process.exit(1); + } } diff --git a/packages/eslint-config-airbnb/whitespace-async.js b/packages/eslint-config-airbnb/whitespace-async.js index 06f4f89075..f5745b78bb 100755 --- a/packages/eslint-config-airbnb/whitespace-async.js +++ b/packages/eslint-config-airbnb/whitespace-async.js @@ -46,4 +46,7 @@ async function onlyErrorOnRules(rulesToError, config) { return errorsOnly; } -onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))); +onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))).catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/packages/eslint-config-airbnb/whitespace.js b/packages/eslint-config-airbnb/whitespace.js index 01e5198671..0415d31616 100644 --- a/packages/eslint-config-airbnb/whitespace.js +++ b/packages/eslint-config-airbnb/whitespace.js @@ -51,11 +51,16 @@ if (CLIEngine) { const path = require('path'); 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 { + // 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, + } + }))); + } catch (error) { + console.error('Error loading whitespace config:', error.message); + process.exit(1); + } }