pub icon indicating copy to clipboard operation
pub copied to clipboard

Warn about presence of custom top-level fields in pubspec.yaml

Open jonasfj opened this issue 7 years ago • 1 comments

The documentation page for pubspec states that additional top-level fields are ignored.

A recent analysis of all pubspecs from packages published on pub.dartlang.org suggests that many custom properties are unintended typos, see: https://github.com/dart-lang/pub-dartlang-dart/issues/1898#issuecomment-450872744

I propose that pub get and pub publish should warn about the presence of custom top-level fields.

This could help prevent a lot of people from debugging typos, like @szakarias who couldn't spell dependency_overrides and spent an hour debugging weird behavior :smile:

/cc @munificent

jonasfj avatar Jan 16 '19 14:01 jonasfj

We have warned in pub publish for quite some time if we believe we find a typo. (if there is a top-level field with low edit-distance to a known field)

Should we consider doing the same in pub get?

sigurdm avatar Aug 28 '24 13:08 sigurdm