Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more native properties #174

Open
abdonrd opened this issue Jun 30, 2023 · 2 comments
Open

Add more native properties #174

abdonrd opened this issue Jun 30, 2023 · 2 comments

Comments

@abdonrd
Copy link

abdonrd commented Jun 30, 2023

There is the no-native-attributes rule:

https://github.com/43081j/eslint-plugin-lit/blob/master/docs/rules/no-native-attributes.md

But we also want to avoid native properties like className:

https://developer.mozilla.org/en-US/docs/Web/API/Element/className

We should have a different rule?
Or just add more elements to the array?

const NATIVE_ATTRS = [
'accesskey',
'autocapitalize',
'autofocus',
'class',
'contenteditable',
'contextmenu',
'dir',
'draggable',
'enterkeyhint',
'exportparts',
'hidden',
'id',
'inert',
'inputmode',
'is',
'itemid',
'itemprop',
'itemref',
'itemscope',
'itemtype',
'lang',
'nonce',
'part',
'popover',
'role',
'slot',
'spellcheck',
'style',
'tabindex',
'title',
'translate',
'virtualkeyboardpolicy'
];

Thanks!

@43081j
Copy link
Owner

43081j commented Jul 11, 2023

sorry for the slow response, have been away the last few weeks

you've got a very good point.

it'd be so easy to just add them to the list, but i do feel like the right thing to do is probably two rules:

  • no-native-attributes
  • no-native-properties

basically identical code other than the list of names.

what do you think?

@abdonrd
Copy link
Author

abdonrd commented Jul 11, 2023

I have the same feelings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants