Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

No error handling around execSync + JSON.parse in whitespace.js (ESLint 9 path)

未关闭
#3,238 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@dataCenter430 已经在做这个了。

开始于 2026年3月6日。

  • #3239 来自 @dataCenter430 —— 未关闭
  • #3306 来自 @loulanyue —— 已关闭,未合并
  • #3319 来自 @bodapatisaikrishna —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
eslint, javascript
领域
tooling

调研方向

从 packages/eslint-config-airbnb-base/whitespace.js 和 packages/eslint-config-airbnb/whitespace.js 的第 55 行开始,跟踪 CLIEngine 不可用时使用 execSync 和 JSON.parse 的路径。完成标准是:子脚本失败和无效输出会生成清晰的诊断信息,同时成功加载配置的功能继续正常工作。

由索引模型根据 Issue 内容生成。

描述

Summary

When CLIEngine is not available (e.g. ESLint 9), whitespace.js loads the config by running whitespace-async.js with execSync and then doing JSON.parse(String(...)) on the result. There is no try/catch around this.

Impact

  • If the child script exits non-zero, prints errors, or prints non-JSON (e.g. ESLint timing or debug output), execSync may throw or return non-JSON.
  • JSON.parse will then throw and the config load fails with a generic parsing error, making it hard to see that the real failure was in the child script.

Affected files

  • packages/eslint-config-airbnb-base/whitespace.js (line 55)
  • packages/eslint-config-airbnb/whitespace.js (line 55)

Suggested fix

Wrap the execSync call and JSON.parse in try/catch and rethrow with a clear message (and optionally cause: err) so failures are easier to diagnose.

screenshot

Image

I'd love to work on this.

主要语言
JavaScript
星标
148k
派生
26.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

airbnb/javascript 的其他 Issue

查看 airbnb/javascript 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。