question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule request [no-unknown-html-attributes]

See original GitHub issue

It’s really easy to create mistake (especially for newcomers) working with arguments/attributes in Angle components.

example

<FlashMessage flash={{flash}} />

vs

<FlashMessage @flash={{flash}} />

And it’s likely hard to debug, because it’s impossible to get list of passed to component html attributes (even in ember inspector) cc @chancancode

I wondering, is it make sence to have all list of possible attributes, and produce error if developer trying to specify invalid html attribute for Angle component?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rwjbluecommented, Jun 29, 2020

we can start from this, and later land new attributes.

I don’t think so. This technique would mean that we start with a non-trivial number of invalid errors being flagged. That just isn’t a good trade off.

We’d also have to properly account for web components, but that seems fairly easy…

for now we can completely skip validation for web components, I thing we can start with applying this rule only for Angle components (not all nodes), and existing list of attributes should cover > 90% use-cases

See, told you it was easy 😉

0reactions
lifeartcommented, Jun 29, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

[no-unknown-property] data-* attributes should be allowed to ...
Technically HTML tags and their attributes are case insensitive [1]. But React types generally prevent usage of the uppercase/mixed case ...
Read more >
HTML attribute reference - HTML: HyperText Markup Language
Attribute Name Elements Description accept‑charset List of supported charsets. align, , , , , , , , , , , , , Specifies the horizontal...
Read more >
Available rules - HTML-validate
Available rules ; attr-delimiter, Disallow whitespace between attribute key and value ; attr-spacing, Require attributes to be separated by whitespace ; close-attr ...
Read more >
Is it OK to use unknown HTML tags? - Stack Overflow
The rule for custom elements is that you need to use a hyphen in the name. If you do that, you're guaranteed to...
Read more >
Rules | Stylelint
Disallow unknown things with these no-unknown rules. ... selector-attribute-quotes : Require or disallow quotes for attribute values (Autofixable).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found