chore(linter): port additional tests from unicorn/prefer-at rule.#17632
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports additional test cases from the upstream eslint-plugin-unicorn prefer-at rule that were not previously included. The tests are dynamically generated in the upstream project and were not picked up by the rulegen logic. Some of the newly added test cases are commented out because they currently fail.
- Added 9 new passing test cases for
checkAllIndexAccess: trueoption - Added 2 new failing test cases that currently pass (tests for
array[1]andarray[array.length - 1]) - Commented out 13 additional failing test cases to be fixed later
- Fixed indentation in existing multi-line test strings to use consistent spacing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/unicorn/prefer_at.rs | Added new test cases for checkAllIndexAccess option, including passing tests and failing tests (some commented out); fixed indentation in multi-line test strings |
| crates/oxc_linter/src/snapshots/unicorn_prefer_at.snap | Updated snapshot with new test outputs for the two uncommented failing tests and adjusted line numbers to reflect indentation changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17632 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
…7632) We were missing various tests that are generated dynamically in the upstream tests, unfortunately most of them fail currently. I am unsure if we excluded these test cases intentionally when adding this rule, but I assume not? They don't get picked up by the rulegen logic due to being dynamically generated. See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/8fcae1aa5a3f1f2c6014bf33aeda2f016c0a8d9a/test/prefer-at.js for further context. I copy-pasted these tests over, and then commented out the new ones that failed.
c8016f9 to
431ca00
Compare
We were missing various tests that are generated dynamically in the upstream tests, unfortunately most of them fail currently. I am unsure if we excluded these test cases intentionally when adding this rule, but I assume not? They don't get picked up by the rulegen logic due to being dynamically generated.
See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/8fcae1aa5a3f1f2c6014bf33aeda2f016c0a8d9a/test/prefer-at.js for further context.
I copy-pasted these tests over, and then commented out the new ones that failed.