ziglint Changelog View on GitHub

Z033: Avoid redundant words in type names

Type names should avoid words that add no meaningful information, such as "Value", "Data", "Context", "Manager", "State", "utils", and "misc". Function and value names are outside this rule's scope.

This rule is disabled by default as it can be controversial. Enable it in your .ziglint.zon if you want stricter naming enforcement.

Examples

Bad (when enabled)

const UserData = struct {
    name: []const u8,
};
const StateManager = struct {
    state: State,
};
const AppContext = struct {
    config: Config,
};

Good

const User = struct {
    name: []const u8,
};
const StateStore = struct {
    state: State,
};
const App = struct {
    config: Config,
};

Configuration

To enable this rule, add to your .ziglint.zon:

.{
    .rules = .{
        .Z033 = .{ .enabled = true },
    },
}

Rationale

From the Zig Style Guide:

Avoid these words in type names:

  • Value
  • Data
  • Context
  • Manager
  • State
  • utils, misc, or somebody's initials

Everything is a value, all types are data, everything is context, all logic manages state. Nothing is communicated by using a word that applies to all types.

These words are so generic that they don't help readers understand what the type actually represents. Compare:

This rule is disabled by default because:

  1. Some legitimate uses exist (e.g., wrapping external APIs)
  2. Migration burden on existing codebases can be high
  3. The "right" alternative name is often context-dependent