How to avoid warnings for components registered wi

2019-08-06 05:55发布

问题:

I'm looking to use the github time-elements custom web components in a polymer dart application. They work as expected, however I get the warning:

Warning from polymer (Linter) ... custom element with name "relative-time" not found. See http://goo.gl/5HPeuP#polymer_11 for details.

Following that link explains the problem pretty well:

This warning can also be a false alarm. For instance, when an element is defined programatically using document.registerElement. In that case the polymer build will not be able to see the definition and will produce this warning.

Is there a recommended approach to making those warnings go away - e.g. by manually registering the elements with dart/polymer?

回答1:

There are two options

  • disable the widget
transformers:
- polymer:
    inject_build_logs_in_output: false
  • disable the Polymer linter
transformers:
- polymer:
   lint: false

see also http://dartbug.com/21237