dependency_sorter 0.1.0
dependency_sorter: ^0.1.0 copied to clipboard
Sort your pubspec dependencies alphabetically. A tiny, well-tested CLI that fixes what the `sort_pub_dependencies` lint reports.
example/dependency_sorter_example.dart
import 'package:dependency_sorter/dependency_sorter.dart';
/// Sorts the `dependencies` of a pubspec document.
///
/// Run with `dart run example/dependency_sorter_example.dart`.
void main() {
const unsorted = '''
dependencies:
yaml: any
args: any
''';
final SortResult result = sortPubspecContents(unsorted, SortConfig.defaults);
// ignore: avoid_print
print(result.contents);
}