use-string-in-part-of-directives
Same as use_string_in_part_of_directives in Dart lints
- Group
- Style
- Path
lint/style/use-string-in-part-of-directives- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 506 of 512
Flags a part of directive that names its library instead of using a string URI.
A part of my.library.name; directive identifies the enclosing library by its
declared name, which forces the parent to carry a library name and couples the
part to it indirectly. The URI form, part of 'parent.dart';, points straight at
the containing file, is more robust, and is the form modern Dart tooling prefers.
The rule reports only the named form (a non-empty dotted name with no string URI).
Invalid
part of foo;part of foo;Valid
part of 'main.dart';Configure use-string-in-part-of-directives
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"use-string-in-part-of-directives": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/use-string-in-part-of-directives: <reason>More style rules
- use-super-parameters
use_super_parametersrecommendedPrefer super parameters when a constructor only forwards parameters to its superclass.
- use-test-throws-matchers
use_test_throws_matchersrecommendedPrefers
throwsAmatchers overtry { ...; fail(...); } catch (...) {}. - use-to-and-as-if-applicable
use_to_and_as_if_applicableFlags conversion methods not named
to…oras…. - always-declare-return-types
always_declare_return_typesrecommendedFlags functions and methods declared without a return type.
- always-put-control-body-on-new-line
always_put_control_body_on_new_lineFlags a control-flow body that starts on the same line as its control clause.
- always-put-required-named-parameters-first
always_put_required_named_parameters_firstFlags a required named parameter declared after an optional named one.
- always-specify-types
always_specify_typesRequires explicit type annotations everywhere a type could be inferred.
- annotate-overrides
annotate_overridesrecommendedRequires
@overrideon members that override an inherited declaration.