feat(linter): auto-fixer for extra cases in unicorn/prefer-query-selector#16787
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the prefer-query-selector linter rule to provide automatic fixes for getElementById calls with non-literal arguments (e.g., variables, expressions). The fix transforms these calls into querySelector calls using template literal interpolation.
Key Changes:
- Added auto-fix support for
getElementByIdwith non-literal arguments by wrapping them in template literals with the#selector prefix - Added test case demonstrating the fix for
getElementById(searchInputId)→querySelector(\#${searchInputId}`)`
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #16787 will not alter performanceComparing Summary
Footnotes
|
83412ad to
df4f680
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
df4f680 to
7f29287
Compare
|
Feel free to adjust the title further, just wanted to make sure the title was clear about fixing a bug vs. adding autofixer logic |
Closes #16786