@@ -135,11 +135,20 @@ final Map<PackageWarning, PackageWarningDefinition> packageWarningDefinitions =
135
135
PackageWarning .ignoredCanonicalFor: PackageWarningDefinition (
136
136
PackageWarning .ignoredCanonicalFor,
137
137
'ignored-canonical-for' ,
138
- 'A @canonicalFor tag refers to a library which this symbol can not be canonical for' ),
138
+ 'A @canonicalFor tag refers to a library which this symbol can not be '
139
+ 'canonical for' ),
139
140
PackageWarning .noCanonicalFound: PackageWarningDefinition (
140
141
PackageWarning .noCanonicalFound,
141
142
'no-canonical-found' ,
142
- 'A symbol is part of the public interface for this package, but no library documented with this package documents it so dartdoc can not link to it' ),
143
+ 'A symbol is part of the public interface for this package, but no '
144
+ 'library documented with this package documents it so dartdoc can '
145
+ 'not link to it' ),
146
+ PackageWarning .noDefiningLibraryFound: PackageWarningDefinition (
147
+ PackageWarning .noDefiningLibraryFound,
148
+ 'no-defining-library-found' ,
149
+ 'The defining library for an element could not be found; the library may '
150
+ 'be imported or exported with a non-standard URI' ,
151
+ defaultWarningMode: PackageWarningMode .error),
143
152
PackageWarning .notImplemented: PackageWarningDefinition (
144
153
PackageWarning .notImplemented,
145
154
'not-implemented' ,
@@ -245,6 +254,7 @@ enum PackageWarning {
245
254
ambiguousReexport,
246
255
ignoredCanonicalFor,
247
256
noCanonicalFound,
257
+ noDefiningLibraryFound,
248
258
notImplemented,
249
259
noLibraryLevelDocs,
250
260
packageOrderGivesMissingPackageName,
@@ -441,9 +451,7 @@ class PackageWarningCounter {
441
451
PackageWarningOptionContext config =
442
452
element? .config ?? packageGraph.defaultPackage.config;
443
453
var warningMode = config.packageWarningOptions.getMode (kind);
444
- if (! config.allowNonLocalWarnings &&
445
- element != null &&
446
- ! element.package.isLocal) {
454
+ if (! config.allowNonLocalWarnings && ! (element? .package? .isLocal ?? true )) {
447
455
warningMode = PackageWarningMode .ignore;
448
456
}
449
457
if (warningMode == PackageWarningMode .warn) {
0 commit comments