code_builder
code_builder copied to clipboard
feat: merge simplePrefixing allocator ignore with other file ignores
Using Allocator.simplePrefixing() with a library decalaration resulted in bad formatted code:
Library((b) => b
..docs.add(
'/// My favorite library.',
)
..body.add(Field((b) => b
..name = 'test'
..modifier = FieldModifier.final$
..assignment = Code.scope((a) => '${a($LinkedHashMap)}()'))))
was generating:
/// My favorite library.
library; // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:collection' as _i1;
final test = _i1.LinkedHashMap();
This PR merges the no_leading_underscores_for_library_prefixes ignore with the other file level ignores for better readable code.
- [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our contributor guide for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Contributions to our repos should follow the Dart style guide and use
dart format. - Most changes should add an entry to the changelog and may need to rev the pubspec package version.
- Changes to packages require corresponding tests.
Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.