Skip to content

no-empty-source

Reports a file with nothing but whitespace. A file with only comments is not empty.

An empty stylesheet is a mistake: either the content was lost or the file is not needed. A build that imports it then loads a file that does nothing.

css:
lint:
rules:
no-empty-source: warn # off (default), warn, error
less:
lint:
rules:
no-empty-source: warn # off (default), warn, error
scss:
lint:
rules:
no-empty-source: warn # off (default), warn, error

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line no-empty-source in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint no-empty-source full