library-names

Same as library_names in Dart lints

Group
Style
Path
lint/style/library-names
Default
On (recommended)
Origin
Dart lints
Rule
252 of 512
recommended

Flags a library name that is not lowercase_with_underscores.

Library names are global identifiers; Effective Dart spells them in lower case with underscores, with optional dot-separated segments:

library peg_parser.source_scanner;  // fine
library PegParser.SourceScanner;    // flagged

The first segment may start with one underscore or a digit; later segments must start with a lower-case letter.

Invalid

example.dartdart
// Library names must be lower_case_with_underscores, dot-separated.
library PegParser.SourceScanner;

void main() {}
The library name `PegParser.SourceScanner` isn't a `lower_case_with_underscores` identifier.
1// Library names must be lower_case_with_underscores, dot-separated.
2library PegParser.SourceScanner;

Valid

example.dartdart
// Lower-case, underscore-separated, dot-separated library name.
library peg_parser.source_scanner;

void main() {}

Configure library-names

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

falcon.jsonjson
{
  "linter": {
    "rules": {
      "style": {
        "library-names": "error"
      }
    }
  }
}

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

example.dartdart
// falcon-ignore lint/style/library-names: <reason>