fisker Cheung
fisker Cheung
```js [...foo].sort() ``` Should definitely go into a new rule like `prefer-array-to-sorted`.
I think it's reasonable to make a generic rule just to forbid `.sort()` except expression statements.
Mentioned in the proposal, they should support https://github.com/tc39/proposal-relative-indexing-method#convertable-interfaces, but seems no browser support `NodeList.at` yet.
Use suggestions instead of autofix?
Add parenthesis won't fix anything, this rule doesn't allow nested ternary > 2 level.
Maybe we should document that.
> Suddenly the inner catch is no longer "useless" because it ensures someOtherThrowyStatement runs. And then if someOtherThrowyStatement throws, there's still the outer catch. That's why I add "lonely" to...
Example, when the `catch` block is a `await expression` ```js showLoading() try { try { await fetch(...) } finally { hideLoading() } } catch { await showErrorMessage() return } //...
It's a good idea. But we have a problem to add this rule. We already have [`prefer-string-slice`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md) rule enforce users move to `String#slice()`. And we can't check `foo.slice(0, 1)`, since...