Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

sneferu format

Format .snf files, theme.json and locale files with Prettier and the Sneferu plugin. Usage, options, output, exit codes and errors.

On this page

Format .snf files, theme.json and locale files with Prettier and the Sneferu plugin.

Rewrites .snf (and .sneferu) files, theme.json and locales in place. With --check nothing is written and the exit code says whether the folder is formatted.

Usage

bash
sneferu format [options] [dir]

Arguments

ArgumentRequiredDefaultDescription
dirno.Theme folder.

Options

OptionDefaultDescription
--checkoffOnly check; exit 1 if a file is not formatted (for CI).

Examples

bash
sneferu format

Formats the current folder.

bash
sneferu format --check

CI: fails when any file needs formatting.

Output

sneferu format my-theme --check (exit 0)

text
✔ all 46 files are formatted

sneferu format my-theme --check (exit 1): After adding a badly formatted snippet.

text
snippets/demo.snf is not formatted
✖ 1 of 47 files need formatting (run sneferu format)

sneferu format my-theme (exit 0)

text
snippets/demo.snf formatted
✔ formatted 1 of 47 files

Exit codes

CodeMeaning
0Formatted, or (with --check) nothing needed formatting.
1With --check, at least one file needs formatting; or formatting failed.

Common errors

None specific to this command beyond the diagnostics it prints.

Next steps