Open pq opened 4 years ago
On a quick scan, it looks like currently our dependencies converge on 2 libraries:
import 'package:linter/src/analyzer.dart';
import 'package:linter/src/util/dart_type_utilities.dart';
(Together they define a lot of potential surface area so we'll want to audit and narrow as much as possible.)
For the analyzer facade, we might want to re-cast some or all of that as extensions on base analyzer classes. At that point we might even be able to get them added to the analyzer package, which would make it easier for them to be maintained as the analyzer changes.
The test utilities should also be looked at to see whether it makes sense to move them into the analyzer package.
Looking specifically at import 'package:linter/src/analyzer.dart'
, this is largely to get LintRule
and NodeLintRule
which are required to define lints. NodeLintRule
is actually no longer needed so I'll work to remove it. LintRule
should become API proper so I'll hoist it up out of src/
.
Relevant discussion: https://dart-review.googlesource.com/c/sdk/+/149122.
Though not designed as a package for extension, the linter is increasingly be used as one. To make this sane, we should define an API and be mindful of breaking changes.
/fyi @davidmorgan @bwilkerson @srawlins