Eval-free JSON Schema validation + a clean community-review report. Replaces the Ajv validator with the eval-free @cfworker/json-schema, and drives the type-aware ESLint findings from the community.obsidian.md review to zero. The plugin bundle is ~52% smaller.
Changed
- JSON Schema validation now uses
@cfworker/json-schemainstead of Ajv. It is an eval-free, tree-walking validator (nonew Function/ noeval), so the automated review's "dynamic code execution" disclosure no longer applies. The bundle drops from ~176 KB to ~85 KB. Supported drafts are a superset of before (draft-04/07/2019-09/2020-12 vs. draft-07-only); the public validation contract (inline row errors + the error-count banner) is unchanged. formatkeywords are now enforced. The previous Ajv build ran withoutajv-formats, soformat(email,uri,date-time, …) was a no-op annotation. The new validator enforces formats in draft-07 mode, so a value that violates aformatconstraint in an (opt-in) companion schema now reports an error. A structurally malformed companion schema (e.g.{"type": 123}) is still rejected via draft-07 meta-validation; a merely cosmetic, non-URI$idno longer disables validation for the whole file.
Fixed
- The community-review ESLint warnings are now zero. The review's type-aware linter resolved
obsidianto the Vitest mock (via atsconfig.jsonpathsalias), so every Obsidian-typed expression was flagged asno-unsafe-*and one assertion asno-unnecessary-type-assertion. The mock alias is gone fromtsconfig.json(real Obsidian types now resolve), the Vitest mock moved totests/__mocks__/, and the redundant assertions were removed. None of this changes runtime behavior. A committednpm run lint:portalguard now mirrors the review so the warnings cannot silently come back.
Internal
- Added
tsconfig.test.json(editor typing of tests against the mock),eslint.portal.config.mjs+npm run lint:portal, andsrc/core/draft07-meta-schema.ts. The Vitest suite (601 tests) pins the new validator's error granularity and format behavior.