You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you run the analyzer with the --dev flag to get more information?
Did you create a minimal reproduction in the playground?
Completing the items above will greatly improve triaging time of your issue.
Expected behavior
Not sure if this is a bug or enhancement request. But the analyzer should pick up attribute values from literal types, in addition to hard-coded strings.
constAttributes={Variable: "variable",}asconst;classMyElementextendsHTMLElement{// Only the "string" attribute is detectedstaticgetobservedAttributes(){return["string",Attributes.Variable];}}customElements.define('my-element',MyElement);
In this example, the type of Attributes.Variable is "variable", so the analyzer should be able to pick that up as an attribute name. But currently it only detects the "string" attribute.
The way this is used in our project is to have a set of "known" attributes that can be used by different components, mixing etc. and to avoid typos and duplicates.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Checklist
--dev
flag to get more information?Completing the items above will greatly improve triaging time of your issue.
Expected behavior
Not sure if this is a bug or enhancement request. But the analyzer should pick up attribute values from literal types, in addition to hard-coded strings.
See playground: https://custom-elements-manifest.netlify.app/?source=Y29uc3QgQXR0cmlidXRlcyA9IHsKICAgIFZhcmlhYmxlOiAidmFyaWFibGUiLAp9IGFzIGNvbnN0OwoKCmNsYXNzIE15RWxlbWVudCBleHRlbmRzIEhUTUxFbGVtZW50IHsKICAvLyBPbmx5IHRoZSAic3RyaW5nIiBhdHRyaWJ1dGUgaXMgZGV0ZWN0ZWQKICBzdGF0aWMgZ2V0IG9ic2VydmVkQXR0cmlidXRlcygpIHsKICAgIHJldHVybiBbInN0cmluZyIsIEF0dHJpYnV0ZXMuVmFyaWFibGVdOwogIH0KfQoKY3VzdG9tRWxlbWVudHMuZGVmaW5lKCdteS1lbGVtZW50JywgTXlFbGVtZW50KTsK&library=vanilla
In this example, the type of
Attributes.Variable
is"variable"
, so the analyzer should be able to pick that up as an attribute name. But currently it only detects the"string"
attribute.The way this is used in our project is to have a set of "known" attributes that can be used by different components, mixing etc. and to avoid typos and duplicates.
The text was updated successfully, but these errors were encountered: