library-prefixes
Same as library_prefixes in Dart lints
- Group
- Style
- Path
lint/style/library-prefixes- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 253 of 512
Flags import prefixes that are not lower_case_with_underscores.
An import prefix (import '...' as foo;) is a library-style name and should
use lower_case_with_underscores to match Dart's package and library
naming. Prefixes may have one leading $ and leading underscores, then must
start with a lowercase letter and contain only lowercase letters, digits,
and underscores.
Invalid
// Import prefixes must be lower_case_with_underscores.
import 'dart:math' as Math;
import 'dart:async' as MyAsync;
import 'dart:convert' as JSON;
import 'dart:io' as IO;
import 'dart:collection' as CollectionLib;
import 'dart:typed_data' as TypedData; import 'dart:math' as Math;import 'dart:math' as Math;import 'dart:async' as MyAsync;import 'dart:async' as MyAsync;import 'dart:convert' as JSON;import 'dart:convert' as JSON;import 'dart:io' as IO;import 'dart:io' as IO;import 'dart:collection' as CollectionLib;import 'dart:collection' as CollectionLib;import 'dart:typed_data' as TypedData;Valid
// lower_case_with_underscores import prefixes.
import 'dart:math' as math;
import 'dart:async' as async_lib;
import 'dart:convert' as convert;
import 'dart:io' as io;
import 'dart:collection' as collection;
import 'dart:typed_data' as typed_data;Configure library-prefixes
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"library-prefixes": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/library-prefixes: <reason>More style rules
- lines-longer-than-80-chars
lines_longer_than_80_charsFlags source lines longer than 80 characters.
- map-keys-ordering
Flags literal string map keys that violate the configured order.
- matching-super-parameters
matching_super_parametersFlags positional super parameters named differently from the super constructor's corresponding parameter.
- member-ordering
member-orderingFlags class members declared out of the configured order.
- missing-whitespace-between-adjacent-strings
missing_whitespace_between_adjacent_stringsrecommendedFlags adjacent string literals that join two words without a space between them.
- newline-before-break
Requires a blank line before a break that follows another statement.
- newline-before-case
Requires a blank line between successive switch statement case clauses.
- newline-before-constructor
Requires a blank line before constructors following another member.