Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head, first & last rules #373

Merged
merged 1 commit into from
Jul 18, 2023
Merged

head, first & last rules #373

merged 1 commit into from
Jul 18, 2023

Conversation

Endremgs
Copy link
Contributor

  • Add new rule for .head()
  • Modify existing rules for .first() & .last()

Suggest the use of Array.prototype.at() instead for ES13(I would prefer to use Ecmascript 2022, but didn't see any previous use of that convention).

Add rules for head, first & last with Array.prototype.at() given as a
native alternative
@@ -21,7 +21,8 @@
},
"last": {
"compatible": true,
"alternative": "Array.prototype.slice()"
"alternative": "Array.prototype.at(-1) or Array.prototype.slice()",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.prototype.slice() may not be a relevant alternative anymore depending on the version of lodash used, as versions greater than 3.10.1 do not support a second argument in .first() and .last() which I suppose is the primary use case for Array.prototype.slice()

@Endremgs Endremgs temporarily deployed to testing July 18, 2023 17:21 — with GitHub Actions Inactive
@ODudek ODudek merged commit 423a057 into you-dont-need:master Jul 18, 2023
2 checks passed
kodiakhq bot pushed a commit to cloudquery/plugin-sdk-javascript that referenced this pull request Oct 1, 2023
…score to v6.13.0 (#84)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint-plugin-you-dont-need-lodash-underscore](https://togithub.com/you-dont-need/You-Dont-Need-Lodash-Underscore.git) ([source](https://togithub.com/you-dont-need/You-Dont-Need-Lodash-Underscore)) | devDependencies | minor | [`6.12.0` -> `6.13.0`](https://renovatebot.com/diffs/npm/eslint-plugin-you-dont-need-lodash-underscore/6.12.0/6.13.0) |

---

### Release Notes

<details>
<summary>you-dont-need/You-Dont-Need-Lodash-Underscore (eslint-plugin-you-dont-need-lodash-underscore)</summary>

### [`v6.13.0`](https://togithub.com/you-dont-need/You-Dont-Need-Lodash-Underscore/releases/tag/v6.13.0)

[Compare Source](https://togithub.com/you-dont-need/You-Dont-Need-Lodash-Underscore/compare/v6.12.0...v6.13.0)

#### What's Changed

-   Add \_.capitalize by [@&#8203;iandrewt](https://togithub.com/iandrewt) in [you-dont-need/You-Dont-Need-Lodash-Underscore#320
-   Add \_.unionBy by [@&#8203;iandrewt](https://togithub.com/iandrewt) in [you-dont-need/You-Dont-Need-Lodash-Underscore#319
-   Add rule for \_.defaults by [@&#8203;cupofjoakim](https://togithub.com/cupofjoakim) in [you-dont-need/You-Dont-Need-Lodash-Underscore#322
-   Remove duplicate \_.uniq by [@&#8203;Semigradsky](https://togithub.com/Semigradsky) in [you-dont-need/You-Dont-Need-Lodash-Underscore#325
-   adding \_.uniqWith by [@&#8203;JasonCubic](https://togithub.com/JasonCubic) in [you-dont-need/You-Dont-Need-Lodash-Underscore#323
-   Fix \_.isString alternative by [@&#8203;Semigradsky](https://togithub.com/Semigradsky) in [you-dont-need/You-Dont-Need-Lodash-Underscore#324
-   Add \_.isDate by [@&#8203;MarcosEllys](https://togithub.com/MarcosEllys) in [you-dont-need/You-Dont-Need-Lodash-Underscore#326
-   Remove unnecessary falsey checks by [@&#8203;suspiciousfellow](https://togithub.com/suspiciousfellow) in [you-dont-need/You-Dont-Need-Lodash-Underscore#328
-   Add \_.lowerFirst by [@&#8203;Semigradsky](https://togithub.com/Semigradsky) in [you-dont-need/You-Dont-Need-Lodash-Underscore#329
-   Add more suggestions for \_.first by [@&#8203;twjasa](https://togithub.com/twjasa) in [you-dont-need/You-Dont-Need-Lodash-Underscore#332
-   Add note to `isArrayBuffer` and add it to eslint plugin by [@&#8203;Semigradsky](https://togithub.com/Semigradsky) in [you-dont-need/You-Dont-Need-Lodash-Underscore#330
-   feat(typescript-examples): \_.pull by [@&#8203;casaper](https://togithub.com/casaper) in [you-dont-need/You-Dont-Need-Lodash-Underscore#310
-   feat: add lodash/fp support by [@&#8203;jpickwell](https://togithub.com/jpickwell) in [you-dont-need/You-Dont-Need-Lodash-Underscore#341
-   Add Array.at(-1) which equals to \_.last by [@&#8203;kingyue737](https://togithub.com/kingyue737) in [you-dont-need/You-Dont-Need-Lodash-Underscore#343
-   update collectionKeyBy so it works for objects by [@&#8203;ImTheTom](https://togithub.com/ImTheTom) in [you-dont-need/You-Dont-Need-Lodash-Underscore#345
-   Fix: errorneous description for \_.isNull by [@&#8203;Koura](https://togithub.com/Koura) in [you-dont-need/You-Dont-Need-Lodash-Underscore#336
-   Update README.md by [@&#8203;BtM909](https://togithub.com/BtM909) in [you-dont-need/You-Dont-Need-Lodash-Underscore#357
-   Bump qs from 6.3.2 to 6.3.3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [you-dont-need/You-Dont-Need-Lodash-Underscore#354
-   Docs: remove david-dm.org badge from README by [@&#8203;SukkaW](https://togithub.com/SukkaW) in [you-dont-need/You-Dont-Need-Lodash-Underscore#348
-   Bump minimatch from 3.0.4 to 3.1.2 by [@&#8203;dependabot](https://togithub.com/dependabot) in [you-dont-need/You-Dont-Need-Lodash-Underscore#358
-   Fix \_first test by [@&#8203;AlexP11223](https://togithub.com/AlexP11223) in [you-dont-need/You-Dont-Need-Lodash-Underscore#352
-   Update edge support in README.md by [@&#8203;gilly3](https://togithub.com/gilly3) in [you-dont-need/You-Dont-Need-Lodash-Underscore#360
-   The debounce function does not work if 'immediate' is true by [@&#8203;ChenKun1997](https://togithub.com/ChenKun1997) in [you-dont-need/You-Dont-Need-Lodash-Underscore#362
-   feat: add workflows PR & master by [@&#8203;Abdel-Monaam-Aouini](https://togithub.com/Abdel-Monaam-Aouini) in [you-dont-need/You-Dont-Need-Lodash-Underscore#359
-   fix: add package-lock to run workflow by [@&#8203;Abdel-Monaam-Aouini](https://togithub.com/Abdel-Monaam-Aouini) in [you-dont-need/You-Dont-Need-Lodash-Underscore#364
-   head, first & last rules by [@&#8203;Endremgs](https://togithub.com/Endremgs) in [you-dont-need/You-Dont-Need-Lodash-Underscore#373
-   Update README.md by [@&#8203;TawalMc](https://togithub.com/TawalMc) in [you-dont-need/You-Dont-Need-Lodash-Underscore#374

#### New Contributors

-   [@&#8203;iandrewt](https://togithub.com/iandrewt) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#320
-   [@&#8203;Semigradsky](https://togithub.com/Semigradsky) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#325
-   [@&#8203;JasonCubic](https://togithub.com/JasonCubic) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#323
-   [@&#8203;MarcosEllys](https://togithub.com/MarcosEllys) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#326
-   [@&#8203;suspiciousfellow](https://togithub.com/suspiciousfellow) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#328
-   [@&#8203;twjasa](https://togithub.com/twjasa) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#332
-   [@&#8203;jpickwell](https://togithub.com/jpickwell) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#341
-   [@&#8203;kingyue737](https://togithub.com/kingyue737) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#343
-   [@&#8203;ImTheTom](https://togithub.com/ImTheTom) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#345
-   [@&#8203;Koura](https://togithub.com/Koura) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#336
-   [@&#8203;BtM909](https://togithub.com/BtM909) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#357
-   [@&#8203;AlexP11223](https://togithub.com/AlexP11223) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#352
-   [@&#8203;gilly3](https://togithub.com/gilly3) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#360
-   [@&#8203;ChenKun1997](https://togithub.com/ChenKun1997) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#362
-   [@&#8203;Abdel-Monaam-Aouini](https://togithub.com/Abdel-Monaam-Aouini) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#359
-   [@&#8203;Endremgs](https://togithub.com/Endremgs) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#373
-   [@&#8203;TawalMc](https://togithub.com/TawalMc) made their first contribution in [you-dont-need/You-Dont-Need-Lodash-Underscore#374

**Full Changelog**: you-dont-need/You-Dont-Need-Lodash-Underscore@v6.12.0...v6.13.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants