Catalogs and SchemaStore
Catalog matching lets DollarLint infer schemas for well-known filenames
— think package.json, tsconfig.json, and
friends — without anyone having to declare $schema by hand. SchemaStore
is the built-in catalog.
Enable catalog matching
dollarlint validate . --schema-store
Catalog matching is optional at runtime unless it is enabled in .dollarlint.toml. Explicit in-file schemas, config associations, and DollarLint's
built-in .dollarlint.toml association still take precedence.
Use a custom catalog
dollarlint validate . --schema-store-url ./catalog.json
In config, use schemas.catalogs and one or more schemas.catalogs.sources. Sources follow the SchemaStore catalog format, including a top-level schemas array with fileMatch and url entries.
[schemas.catalogs]
enabled = true
failure = "warn"
[[schemas.catalogs.sources]]
name = "company"
format = "schemastore"
path = "./catalog.json"
enabled = true
[[schemas.catalogs.sources]]
name = "schemastore"
format = "schemastore"
url = "https://www.schemastore.org/api/json/catalog.json"
enabled = true
A source must use exactly one of url or path.
Relative schema URLs inside a catalog are resolved relative to that
catalog.
Choose what happens when catalog validation can't run
| Policy | Behavior |
|---|---|
warn | Log a warning, skip catalog inference or catalog-inferred validation, and keep validating explicit or configured schemas. |
error | Stop the run — if you're counting on the catalog, this makes sure it's non-negotiable. |
skip | Quietly move on without catalog inference. No news is good news. |
dollarlint validate . --schema-store --schema-store-failure error
If schemas.fetch.enabled = false, remote catalogs are
unavailable. With the default warn policy, DollarLint warns and
keeps validating explicit or configured local schemas. The same policy applies
when a catalog loads but the schema it matched cannot be fetched or compiled.
Files that explicitly declare remote schemas still report schema-loading issues
when remote fetching is disabled.
If you restrict remote domains while using SchemaStore, allow *.schemastore.org or include both www.schemastore.org and json.schemastore.org; many SchemaStore URLs resolve through the JSON host.