fix: allow sorting and mutating arrays due perf + bump lockfile - #434
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #434 +/- ##
=======================================
Coverage 93.38% 93.38%
=======================================
Files 1 1
Lines 121 121
Branches 48 47 -1
=======================================
Hits 113 113
Misses 7 7
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| extends: [configs["recommended-dirty"]], | ||
| rules: { | ||
| "unicorn/no-array-sort": "off", | ||
| }, |
There was a problem hiding this comment.
We should not do it, we should fix it, eslint rules should be not suppressed, that they rules without the real problems
There was a problem hiding this comment.
We can use toSorted instead but it will impact performance, so that's why this is a lint change instead
There was a problem hiding this comment.
How it impacts performance?
There was a problem hiding this comment.
We use it in many places
There was a problem hiding this comment.
toSorted created a copy instead of modifying/mutating the array, so more memory will be used.
There was a problem hiding this comment.
it means we may have a potential problem/bug and code should be rewritten, never disable rules like because you want, each disabling should have a comment and why it was disabled, and where and how it should be resolve in future, it is very bad practice just disable
Summary
Allows using
Array.sortin eslint, could be replaced byarray.toSorted, but it will impact perf. Updated lockfile too.What kind of change does this PR introduce?
fix
Did you add tests for your changes?
N/A
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
N/A
Use of AI
Claude helped with implementation.