depend-on-referenced-packages
Same as depend_on_referenced_packages in Dart lints
- Group
- Correctness
- Path
cross-file/correctness/depend-on-referenced-packages- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 215 of 512
Cross-file rule. It runs in falcon's whole-project pass, analyzing relationships across every file rather than one file at a time. Configure it under the top-level cross-file key.
Require imported packages to be declared in pubspec.yaml.
Imports from lib/ and bin/ must name a regular dependency. Imports from
development-only locations such as test/ and tool/ may also name a
dev-dependency. SDK imports and imports of the package itself are ignored.
Like the analyzer, only the primary URI is checked, not conditional alternatives.
When undeclared-dependencies is enabled for a file, that rule owns missing
declarations and dev-dependencies imported from lib/; this rule only adds
its stricter executable/build-hook dependency check, avoiding duplicate reports.
Invalid
import 'package:http/http.dart';
void main() {}import 'package:http/http.dart';Configure depend-on-referenced-packages
Set its severity in falcon.json under the cross-file section. See the configuration guide.
{
"cross-file": {
"rules": {
"correctness": {
"depend-on-referenced-packages": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore cross-file/correctness/depend-on-referenced-packages: <reason>More correctness rules
- deprecated-member-use-from-same-package
deprecated_member_use_from_same_packageReports uses of deprecated declarations from their own package.
- diagnostic-describe-all-properties
diagnostic_describe_all_propertiesflutterRequires every public property of a
Diagnosticableclass to be referenced in its debug methods. - discarded-futures
discarded_futuresDon't discard
Futures returned by calls in synchronous functions. - dispose-fieldsrecommendedflutter
Requires other owned disposable State fields to be released in
dispose(). - dispose-focus-node-and-timerrecommendedflutter
Requires owned
FocusNodeand Timer fields to be released inState.dispose(). - dispose-provided-instancesrecommendedriverpod
Flags provider-created instances with a dispose method that lack ref.onDispose cleanup.
- dispose-provider-resourcesrecommendedriverpod
Flags provider-created resources without autoDispose or ref.onDispose cleanup.
- dispose-providersrecommendedprovider
Requires cleanup callbacks for disposable values created by package:provider's Provider.