DonIsaac/zlint
A linter for the Zig programming language
refs
7c7477fa76da53c2791f9e1f860481f64140ccbc.zip
36133afaa1b085db7063ffc97c08ae0bddc2de4e.zip
An opinionated linter for the Zig programming language.
Pre-built binaries for Windows, MacOS, and Linux on x64 and aarch64 are available for each release.
curl -fsSL https://raw.githubusercontent.com/DonIsaac/zlint/refs/heads/main/tasks/install.sh | bash
WARNING This installation script does not work on Windows. Please download Windows binaries directly from the releases page.
Clone this repo and compile the project with Zig.
zig build --release=safe
All lints and what they do can be found here.
Create a zlint.json
file in the same directory as build.zig
. This disables
all default rules, only enabling the ones you choose.
{
"rules": {
"unsafe-undefined": "error",
"homeless-try": "warn"
}
}
ZLint also supports ESLint-like disable directives to turn off some or all rules for a specific file.
// zlint-disable unsafe-undefined -- We need to come back and fix this later
const x: i32 = undefined;
If you have any rule ideas, please add them to the rule ideas board.
Interested in contributing code? Check out the contributing guide.