Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[FEATURE]: Validate config options

未關閉
#8,067 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
65/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript
領域
tooling

研究方向

Look at the config object definition in src/plot_api/plot_config.js and the configAttributes schema. Use Lib.validate and Lib.warn from lib/index.js to check incoming config keys and values against the schema, skipping valType: 'any'. Test by creating a plot with an invalid config key like 'shapePositon' and verifying a warning appears in the console.

由索引模型根據 Issue 內容生成。

描述

enhancement feature P3 plotly-internal size: 3
Description

Validate the config object against configAttributes and warn on anything that does not match. Do not change the value.

Why should this feature be added?

Config is the only user-facing input plotly.js never checks. Plotly.validate takes data and layout only. A typo like edits: { shapePositon: true } does nothing, reports nothing, and costs the user an afternoon.

plotly.py already wants this. plotly/offline/offline.py warns on unknown keys from a hardcoded tuple, with the comment: "we don't have code generation logic in place yet to guarantee that the config options in plotly.py are up to date". Schema-driven validation in plotly.js gives every port the list.

Notes
  • An unknown key gets dropped with no notice
  • A value that fails its valType doesn't get stopped
  • We should warn on invalid values. Coercion would replace bad values with defaults and silently change charts that work today.
  • Utilize the existing Lib.validate and Lib.warn
  • Skip the five attributes whose valType is any. Lib.validate accepts anything for them.
  • This should only validate the incoming config, not the resolved _context
  • This might be noisy for users until configs are corrected
主要語言
JavaScript
星號
18.3k
分支
2k
平均合併
2 天 10 小時
30 天內合併 PR
30

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/plotly.js 的其他 Issue

查看 plotly/plotly.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。