Search code examples
typescripttsconfig

What is the use of $schema property use in the tsconfig.json


I see $schema property used by some best practice tools like @tsconfigs/node16 etc.

What is the use of this property? The contents of the URL pointing to the $schema property has keys that are not directly present in tsconfig.json but rather seems to influence the definition of the tsconfig properties itself.

Eg. https://json.schemastore.org/tsconfig

I tried exploring the property typescript documentation but did not find any there.


Solution

  • It's a reference to the JSON Schema that the document adheres to.

    The schema describes the structure and format of the JSON document, and can also be used to validate the document.