Skip to content

Commit

Permalink
feat(eslint-plugin): [prefer-at] docs fixes
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
  • Loading branch information
sviat9440 and JoshuaKGoldberg committed Apr 16, 2023
1 parent ac0bbcf commit 1f557c6
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/eslint-plugin/docs/rules/prefer-at.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,8 @@ There are two ways to get the last item of the array:

`arr.at(-1)` is a cleaner equivalent to `arr[arr.length - 1]`.

This rule supports the following types:

- `string` or `String`
- `Array`
- `Int8Array`
- `Uint8Array`
- `Uint8ClampedArray`
- `Int16Array`
- `Uint16Array`
- `Int32Array`
- `Float32Array`
- `Uint32Array`
- `Float64Array`
- `BigInt64Array`
- `BigUint64Array`
This rule suggests code use `arr.at(-1)`, as it's cleaner than `arr[arr.length - 1]`.
It supports built-in array and string types, including integer arrays such as `Int8Array`.

## Options

Expand Down

0 comments on commit 1f557c6

Please sign in to comment.