eol-at-end-of-file

Same as eol_at_end_of_file in Dart lints

Group
Style
Path
lint/style/eol-at-end-of-file
Default
On (recommended)
Origin
Dart lints
Rule
233 of 512
recommended

Flags a non-empty file that does not end with exactly one line break.

A missing final newline breaks tools that process files line by line, and extra blank lines at the end are noise. Both are reported at the end of the last non-whitespace character:

void f() {}⏎        // fine
void f() {}         // flagged: no newline at the end
void f() {}⏎⏎       // flagged: more than one newline at the end

Invalid

example.dartdart
void main() {}
Missing a newline at the end of the file.
1void main() {}

Valid

example.dartdart
void main() {}

Configure eol-at-end-of-file

Set its severity in falcon.json. See the configuration guide.

falcon.jsonjson
{
  "linter": {
    "rules": {
      "style": {
        "eol-at-end-of-file": "error"
      }
    }
  }
}

Or silence one occurrence with a suppression comment; the reason is required.

example.dartdart
// falcon-ignore lint/style/eol-at-end-of-file: <reason>
  • extend-equatableequatable

    Require Equatable semantics for configured class/file name patterns.

  • file-namesfile_namesrecommended

    Enforces lowercase_with_underscores for source file names.

  • flutter-style-todosflutter_style_todos

    Flags TODO comments that do not follow the Flutter style // TODO(username): message, https://URL-to-issue.

  • format-commentformat-comment

    Flags comments that are not formatted as complete sentences.

  • implicit-call-tearoffsimplicit_call_tearoffs

    Explicitly tear off callable objects' call methods.

  • initializers-ordering

    Requires field initializers to follow their containing type's field declaration order by default.

  • leading-newlines-in-multiline-stringsleading_newlines_in_multiline_strings

    Flags a multiline string spanning several lines whose text does not start with a line break right after the opening quotes.

  • library-annotationslibrary_annotationsrecommended

    Requires library-targeted metadata to attach to a library directive.