Open DartBot opened 9 years ago
I suppose we could hard-code a list of typos we expect, although I'm not sure exactly what such a list would look like. Any broader heuristic seems too likely to have some false positives, especially since we'd like current pubs to be as compatible as possible with future pubspecs.
@alan-knight @rnystrom Do either of you have suggestions for a list of expected typos?
We have implemented this as a pre-publication validation:
* "dependencie" is not a key recognized by pub - did you mean "dependencies"?
Sorry, your package is missing some requirements and can't be published yet.
For more information, see: https://dart.dev/tools/pub/cmd/pub-lish.
@jonasfj should we consider spell-checking on pub get/upgrade/add/remove
?
The pubspec.yaml is an open format on purpose, and we cannot really know what other packages put in there.
We can only do checks for keys that are similar to keys known by pub. I think that would be frustrating quickly if there was a false positive.
This could also be implemented as some kind of lint in the analyzer - in that case you could # ignore
if you have an unknown key in your pubspec.
@pq do you think this would be a good solution?
Totally. Implementing this as a lint or a warning in the analyzer seems like a good solution to me.
Issue by alan-knight Originally opened as dart-lang/sdk#21287
I spent a bit of time wondering why my transformer wasn't working before realizing I'd written
transformer:
instead of
transformers:
in my pubspec. It would be nice if it did something besides silently ignore this.