Background
crates/mds-wasm/src/lib.rs:429 exposes a check() binding that accepts a JS options object but has no parse_check_options allow-list. This means passing sourceMap: true to WASM check() is silently ignored — the option is accepted without error and has no effect.
Ledger ID: #41 (consistency-mds-wasm/src/lib.rs:429-check_accepts_sourcemap)
File: crates/mds-wasm/src/lib.rs:429, 719-741
Originating reviewer: Consistency
Problem
Why deferred from PR #196
Adding a parse_check_options allow-list on the WASM check binding introduces a new rejection path that would break direct WASM consumers currently passing sourceMap (expecting it to work or unaware it is unsupported). This is a behavior change on a binding surface that should not land immediately before a publish. The documentation half (#40) was the correct in-scope fix for this PR.
Proposed change
Add parse_check_options(opts: JsValue) -> CheckOptions in mds-wasm/src/lib.rs modeled on parse_lint_options, with an allow-list matching the documented set from packages/mds-wasm/README.md. Throw TypeError on unknown keys. Wire it into check().
Acceptance Criteria
Deferred from: PR #196
Background
crates/mds-wasm/src/lib.rs:429exposes acheck()binding that accepts a JS options object but has noparse_check_optionsallow-list. This means passingsourceMap: trueto WASMcheck()is silently ignored — the option is accepted without error and has no effect.Ledger ID: #41 (
consistency-mds-wasm/src/lib.rs:429-check_accepts_sourcemap)File:
crates/mds-wasm/src/lib.rs:429,719-741Originating reviewer: Consistency
Problem
mds-napi'scheckbinding already has a dedicatedparse_check_optionsthat rejects unknown keys viaassertKnownKeys.@mdscript/mds) routes throughassertKnownKeysand shields browser/Node consumers.@mdscript/mds-wasm) have no such protection: unknown keys are accepted and discarded.Why deferred from PR #196
Adding a
parse_check_optionsallow-list on the WASMcheckbinding introduces a new rejection path that would break direct WASM consumers currently passingsourceMap(expecting it to work or unaware it is unsupported). This is a behavior change on a binding surface that should not land immediately before a publish. The documentation half (#40) was the correct in-scope fix for this PR.Proposed change
Add
parse_check_options(opts: JsValue) -> CheckOptionsinmds-wasm/src/lib.rsmodeled onparse_lint_options, with an allow-list matching the documented set frompackages/mds-wasm/README.md. ThrowTypeErroron unknown keys. Wire it intocheck().Acceptance Criteria
parse_check_optionsimplemented inmds-wasm/src/lib.rswith allow-list matching the documented option surfacesourceMap: trueto WASMcheck()throws aTypeErrorwith a clear messagechecktests cover the rejection path[Unreleased]notes this as a breaking change for direct WASM consumers (if applicable)@mdscript/mdsuniversal package behavior unchanged (it already routes through napi'sassertKnownKeys)Deferred from: PR #196