jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.86k stars 2.76k forks source link

[Fix] `no-unknown-property`: only match `data-*` attributes containing `-` #3713

Closed silverwind closed 3 months ago

silverwind commented 3 months ago

This fixes behaviour with the requireDataLowercase option enabled:

  1. For standard HTML elements, a attribute named dataNotAnDataAttribute now raises unknownProp instead of dataLowercaseRequired.
  2. For React components, a attribute named dataNotAnDataAttribute no longer raise an error.

Also, I removed one useless capture group in this regexp.

Fixes: https://github.com/jsx-eslint/eslint-plugin-react/issues/3712

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.76%. Comparing base (da1013c) to head (230f9ec).

:exclamation: Current head 230f9ec differs from pull request most recent head 69de42e. Consider uploading reports for the commit 69de42e to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3713 +/- ## ======================================= Coverage 97.76% 97.76% ======================================= Files 133 133 Lines 9467 9467 Branches 3467 3467 ======================================= Hits 9255 9255 Misses 212 212 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.