Spit out verbose warnings/errors generated by polymer #36
Comments
|
@sorvell @addyosmani @ebidel @arthurevans are there other common mistakes you see developers making that we could warn about? I'm just writing down everything that pops into my head, we can turn these into individual issues to make it easier to manage |
I was thinking of a warning about objects getting unexpectedly shared across multiple instances of an element. Also, I wonder how many of all these are doable. |
Instance of element setting an attribute that is NOT defined as a published attribute of the element (probably a typo). |
Optional trace log of attributes and instance properties observed change events. |
@mckoss also suggested we could create our own static analysis tool like jshint. That may be a better solution for these warnings instead of doing it all in the polymer extension at runtime |
<polymer-element> with child nodes NOT one of <template> or <script>. We had a bug where we put a <style> node as a direct child of (rather than as a child of a element). This was identical to a top-level style definition - which is definitely NOT the intention:
|
Some more thoughts after yesterday's eng meeting: We've explored logging hints about code smells / linting errors to developers in the past as part of the DevTools, in particular around CSS. Warnings like this are useful but need to be done in a way that they can be switched off or easily filtered otherwise we'll end up annoying users who might otherwise find the rest of our features useful. So, if we do this - let's make it opt-in by default but something you can switch off. The setting can be easily persisted in localStorage along with other DevTools settings. |
We could also warn about:
We can also provide a link to the compatibility notes for workarounds. Where possible, we should consider whether we opt for short useful messages with a link to docs vs. longer messages without links imo. |
Are there any examples of running an AST from the devtools to lint code? |
No description provided.
The text was updated successfully, but these errors were encountered: