ziglint Changelog View on GitHub

Z005: Type function names should be PascalCase

Functions that return types should use PascalCase names, following Zig's convention that types are PascalCase.

Examples

Bad

// expect: Z005
fn arrayList(comptime T: type) type {
    return struct { items: []T };
}
// expect: Z005
fn hash_map(comptime K: type, comptime V: type) type {
    return struct {};
}

Good

fn ArrayList(comptime T: type) type {
    return struct { items: []T };
}
fn HashMap(comptime K: type, comptime V: type) type {
    return struct {};
}

Rationale

In Zig, types are always PascalCase. Since type functions return types, they should also be PascalCase. This makes it clear at the call site that the result is a type:

const MyList = ArrayList(u32);  // Clear that MyList is a type

This matches the Zig standard library conventions (ArrayList, HashMap, BoundedArray, etc.).