feat(linter): implement react/display-name rule
I implemented the react/display-name rule. I categorized it as style because it's more idiomatic to add displayNames and helps with debugging, but it does not affect functionality and is not required for React to work.
In order to get all the tests to pass, I needed to add a version and a component_wrapper_functions setting to the react.rs module. This resulted in some snapshot updates.
All the options available for this rule are supported with this change. However, I commented out one specific test from the eslint-plugin-react test suite because when it's enabled, it throws an unexpected token error. It seems like their test suite is expecting Flow rather than TypeScript. I figure that it's out of scope for this project to support Flow, so I didn't bother with this test.
I added some utility functions to the react utils file that were useful for checking for the presence of jsx or a HOC.
I tried to use CompactStr and FxHashSet rather than vec and String where possible. I also tried to make this implementation as simple as possible, but there are a lot of use cases to account for.
I'm open to any feedback you have!
CodSpeed Performance Report
Merging #12084 will not alter performance
Comparing taearls:linter/react-display-name (7b0f0d8) with main (e01c551)
Summary
✅ 4 untouched
⏩ 33 skipped[^skipped]
[^skipped]: 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.
@camc314 I fixed the build on this branch and rebased off of main. this is ready for review whenever you get a chance!
This'll be great to have, thank you!
@camc314 when you get a chance could you give this PR another look? Thanks!