TypeOnly is a lightweight validation library that uses TypeScript type definitions to validate JSON data. Learn more about TypeOnly here.
- typeonly: Parses types and interfaces from TypeScript and stores them as JSON files;
- @typeonly/loader: Brings types and interfaces from TypeScript at runtime;
- @typeonly/validator: An API to validate JSON data or JavaScript objects, using TypeScript typing definitions;
- @typeonly/validator-cli: A CLI to validate JSON files, using TypeScript typing definitions.
We need a JVM (Java Virtual Machine) to build the parser because we use ANTLR, which is a Java program. So, at first, install a JVM on your system.
In a terminal, open the cloned typeonly/typeonly/
repository. Then:
# Download once the ANTLR JAR file in the project's root directory
wget https://www.antlr.org/download/antlr-4.13.2-complete.jar
# Install once all Node.js dependencies
npm install
With VS Code, our recommanded plugins are:
- Biome from biomejs (biomejs.dev)
- ANTLR4 grammar syntax support from Mike Lischke (
mike-lischke.vscode-antlr4
)