Skip to content

Fast, multi-format JSON Schema linter for all your config files

License

Notifications You must be signed in to change notification settings

lintel-rs/lintel

Repository files navigation

Lintel

Fast, multi-format JSON Schema linter for all your config files.

CI crates.io npm

Lintel validates JSON, YAML, TOML, JSON5, and JSONC files against JSON Schema in a single command. It auto-discovers schemas via SchemaStore, the Lintel catalog, inline $schema properties, and YAML modelines — zero config required.

Fast. Written in Rust with no async runtime, deterministic schema caching, and pre-compiled SchemaStore catalog matching. Warm runs are pure computation.

Drop-in CI check. Machine-parseable output, nonzero exit codes on failure, .gitignore-aware file walking. Add one line to your pipeline and catch config mistakes before they ship.

Zero config. Point it at your repo and go. Lintel figures out which schemas to use.

Installation

cargo install lintel

Or with npm:

npx @lintel/lintel check
bunx @lintel/lintel check
pnpx @lintel/lintel check

Or with Nix:

nix run github:lintel-rs/lintel

Usage

# validate with rich terminal output
lintel check

# validate with CI-friendly one-error-per-line output
lintel ci

# generate a lintel.toml with auto-detected schemas
lintel init

# convert between formats
lintel convert config.yaml --to toml

Schema Discovery

Lintel auto-discovers schemas in priority order:

  1. YAML modeline# yaml-language-server: $schema=...
  2. Inline $schema property — in the document itself
  3. lintel.toml mappings — custom [schemas] table entries
  4. Custom registries — additional catalogs from lintel.toml
  5. Lintel catalog — aggregates SchemaStore with additional schemas (Cargo.toml, Claude Code, devenv.yaml, and more)

Files without a matching schema are silently skipped. Lintel respects .gitignorenode_modules, target/, and build artifacts are skipped automatically.

The Lintel Catalog

The Lintel catalog is an aggregate of SchemaStore and additional schemas for tools that don't have SchemaStore entries. When both catalogs have a match, the Lintel catalog takes precedence.

See the lintel-rs/catalog repository for more information.

Currently includes additional schemas for:

  • Cargo.toml — Rust package manifests
  • Claude Code — agent, skill, and command definitions
  • devenv.yaml — devenv configuration

To add your own catalogs, use registries in lintel.toml:

registries = ["github:my-org/my-schemas"]

The github:org/repo shorthand resolves to https://raw.githubusercontent.com/org/repo/master/catalog.json.

Configuration

Lintel supports project configuration via lintel.toml:

# stop walking up the directory tree
root = true

# exclude files from validation
exclude = ["vendor/**", "testdata/**"]

# map file patterns to schema URLs
[schemas]
"my-config.yaml" = "https://example.com/my-schema.json"
".ci/*.yml" = "//schemas/ci.json" # // resolves relative to lintel.toml

# additional schema catalogs
registries = ["github:my-org/my-schemas"]

# rewrite schema URLs (e.g. for local development)
[rewrite]
"http://localhost:8000/" = "//schemas/"

# per-file overrides
[[override]]
files = ["schemas/vector.json"]
validate_formats = false

Adding Lintel to devenv

Add Lintel as an input in devenv.yaml:

inputs:
  lintel:
    url: github:lintel-rs/lintel
    flake: true

Then use it in devenv.nix:

{ pkgs, inputs, ... }:

let
  lintel = inputs.lintel.packages.${pkgs.system}.default;
in
{
  packages = [ lintel ];

  # optional: run lintel as a pre-commit hook
  git-hooks.hooks.lintel = {
    enable = true;
    name = "lintel";
    entry = "${lintel}/bin/lintel check";
    types_or = [ "json" "yaml" ];
  };
}

GitHub Action

Use the official lintel-rs/action:

- uses: lintel-rs/action@v1

License

Copyright Ian Macalinao. Licensed under the Apache License, Version 2.0.

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages