Skip to content

format

Every file: the Prettier layout for the file types it formats, and line endings, final newlines, and trailing whitespace from editorconfig-checker. The format settings set the indentation, line length, quotes, and line endings for every formatter.

Always.

Checks each file Prettier handles for unformatted code.

Runs at the commit stage. gspot check --fix fixes what it can.

Formatting by hand differs by editor; one formatter keeps diffs about the change and not the spacing.

Run the fix: command that the report prints to format the file.

A JavaScript file with const value={enabled:true}; differs from the Prettier output. Run gspot check --fix to format it.

gspot ignore format/prettier --paths "<path>" --reason "<why>"

Checks line endings, final newlines, and trailing whitespace in every file against .editorconfig.

Runs at the commit stage.

These rules cover the files no formatter touches, so a stray tab or missing newline never lands in a diff. The formatters handle indentation.

Fix the line the checker names; most editors apply .editorconfig on save.

A file with CRLF line endings under an .editorconfig that requires LF reports a finding. Save it with LF endings.

gspot ignore format/editorconfig-checker --paths "<path>" --reason "<why>"
Setting What it sets
format.indent_style The character of one indent level.
format.indent_width Spaces per indent level.
format.print_width The line width formatters wrap at.
format.quotes The quote for the languages where a formatter chooses. When unset, Python gets double quotes and the other languages single.
format.trailing_commas Where trailing commas go.
format.semicolons Whether JavaScript and TypeScript statements end with semicolons.
format.bracket_spacing Whether Prettier prints spaces inside the braces of an object.
format.arrow_parens Whether Prettier keeps the parentheses around a single arrow function parameter.
format.prose_wrap How Prettier wraps Markdown prose.
format.override Formatting options for repository-relative paths, in order.
Tool Version
prettier 3.9.10
editorconfig-checker 4.0.2

prettier.config.mjs, .editorconfig, .gspot/configurations/format/prettier.json, and .prettierignore