Configuration

Similar to ESLint, pixel-art-lint supports hierarchical configuration.

Settings live in pixelartlint.toml at the project root or in a subfolder. Override the rules by placing a pixelartlint.toml file inside a subfolder to apply the rules to all children and descendents of that folder.

If no config file is found, default rules are used.

Full example

pixelartlint.toml
[tool.pixel_linter]
severity = "error"

[tool.pixel_linter.palette]
colours = ["#112233ff", "#aabbccff"]
include_transparent = true

[tool.pixel_linter.size]
size = { width = 16, height = 16 }

[tool.pixel_linter.colour_mode]
mode = "indexed"

tool.pixel_linter

  • severity_default: one of error, warn, or off. Used when a rule does not override severity.
  • ignore: a list of globs to ignore (ie: ["wip/*.png", "Sample.aseprite"])

tool.pixel_linter.palette

When present, enables the palette colour rule for files under that config.

  • colours (or alias colors): set of hex strings such as #rrggbbaa. Invalid hex fails config load.
  • include_transparent (default true): when true, fully transparent pixels are allowed even if they are not listed in colours.
  • severity: one of error, warn, or off.

tool.pixel_linter.colour_mode

When present, applies a rule that checks the mode for files under that config. This is only applicable to aseprite files, and grayscale is considered rgba. See aseprite docs for more.

  • mode: one of rgba or indexed.
  • severity: one of error, warn, or off.

tool.pixel_linter.size

When present, applies a rule that checks the dimensions of files under that config.

  • width: the width of the sprite. height: the height of the sprite.
  • severity: one of error, warn, or off.

Ignore Globs

Exclude assets from a scan with an eslint-style glob.

During check, the walker looks for an ignore in the config file of each directory it enters. Patterns from that file apply to files in that directory and everything below it. A config file deeper in the tree overrides ignore patterns; leaving a folder drops its patterns. Sibling folders do not share ignores, just as they do not share configs.

Each ignore is parsed as a glob. A file is skipped when any active pattern matches its path relative to the scan root, its full path, or its file name alone.

pixelartlint.toml
[tool.pixel_linter]
ignore = ["wip/**/*", "*.png", "example.aseprite"]

[tool.pixel_linter.palette]
colours = ["#112233ff", "#aabbccff"]

Place an ignore statement next to the subtree it should affect. For example, sprites/wip/pixelartlint.toml with *.png skips PNGs under wip/ only; assets in sprites/final/ are still checked.

Discovery

During check, each file walks upward from its directory until it finds pixelartlint.toml. Nested trees can use separate configs when needed. Config files are not merged yet, unlike eslint.