Skip to content

[no-unknown-property] data-* attributes should be allowed to have uppercase letters as well #3395

Closed
@HJain13

Description

@HJain13

Technically HTML tags and their attributes are case insensitive [1]. But React types generally prevent usage of the uppercase/mixed case version of the tags and attributes as it conflicts with other established conventions (eg: treating tags with the first letter uppercase as a component in JSX). The typings for React also error out for uppercased attributes.

However, data-attributes are special in this regard; From what I can see data-testId is considered to be valid attribute even by react (though it's automatically lowercase by the browser) (TS enabled react sandbox). Right now the lint rule creates a false positive for this and I am not sure if that should be the case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions