Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to configure `pub build` so that it does not suppress hints and warnings?

I'm trying to not get messages like this when I run pub build:

WARN: [Dart2JS on mylib|web/mylib.dart]:  
    | 1 warning(s) and 2 hint(s) suppressed in package:otherlib.  
WARN: [Dart2JS on pinged|web/mylib.dart]:   
    | 2 warning(s) suppressed in package:mylib.  
WARN: [Warning from Dart2JS on mylib|web/mylib.dart]:  
    | 1 hint(s) suppressed in package:mypackage.  
WARN: [Warning from Dart2JS on pinged|web/mylib.dart]:  
    | 1 hint(s) suppressed in package:otherpackage.

I've tried building with pub build --verbose --trace and adding --verbose to my $dart2js transformer commandLineOptions in pubspec.yaml.

It seems that, by default, dart2js does not suppress hints and warnings (hence the --suppress-warnings and --suppress-hints options), but the pub build "wrapper" around dart2js changes these defaults and gives you no real way to enable verbosity.

like image 718
Lucas Meadows Avatar asked Dec 02 '25 15:12

Lucas Meadows


1 Answers

transformers:
- polymer:
    entry_points: web/index.html
- $dart2js:
    commandLineOptions: [--show-package-warnings] 

see also:

Can you pass compiler flags to dart2js via Dart Editor

https://www.dartlang.org/tools/pub/dart2js-transformer.html

like image 70
Günter Zöchbauer Avatar answered Dec 05 '25 15:12

Günter Zöchbauer