Skip to content

General

Decimal values

toml

Omit leading and trailing zeros in decimal values.

Before

foo: 0.5
bar: 1.0

After

foo: .5
bar: 1

Tip

This rule is inverted on JSON5.

Double quotes

yaml

Double quotes for strings. Quotes are optional in YAML, but must not be single quotes, unless the string itself contains double quotes.

Before

foo: 'foo'
bar: "\"bar\""

After

foo: "foo"
bar: '"bar"'

Warning

Expressions in GitHub Actions must be wrapped in single quotes.

Duplicate blank line

css md properties sql

No more than one consecutive blank line.

Before

Foo


Bar

After

Foo

Bar

Tip

In JSON, no blank lines are allowed at all.

Indent style

md md

Spaces over hard tabs for indentation, default 2 spaces.

Before

- Foo
    - Bar
        - Baz

After

- Foo
  - Bar
    - Baz

Line length

md toml yaml

The column limit is 80 characters.

Before

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum.

After

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
Sed sit amet ipsum.

Tip

There are some exceptions:

  • URLs are allowed to exceed the limit in most formats.
  • In Markdown, headings, tables and inline HTML are also fine.
  • Ignored in JSON.

Trailing comma

toml

In languages that support trailing commas, they should be used in multi-line structures.

Before

[parent]
child = [
    "foo",
    "bar"
]

After

[parent]
child = [
    "foo",
    "bar",
]

Trailing newline

md properties toml

Files should end with a single newline character.

Before

Foo

After

Foo

Trailing space

md yaml

No trailing spaces at the end of lines.

Before

Foo␣

After

Foo

Unnecessary leading blank line

css properties

Files should not start with blank lines.

Before

Foo

After

Foo