Skip to content

chore: enable unicorn/no-for-loop #9628

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

Closed
wants to merge 1 commit into from

Conversation

abrahamguo
Copy link
Contributor

PR Checklist

Overview

Enable unicorn/no-for-loop (docs). All of these are autofixable, and none are flagged by @typescript-eslint/prefer-for-of because the typescript-eslint rule does not flag instances where the index is used.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @abrahamguo!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Jul 24, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 27e26dd
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66a063fbe297d90008245eff
😎 Deploy Preview https://deploy-preview-9628--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Jul 24, 2024

@Josh-Cena
Copy link
Member

Hmmm. I see why they aren't reported by prefer-for-of. I don't terribly like this style but I'll let others decide.

@abrahamguo
Copy link
Contributor Author

Sure thing! Open to input on this, just wanted to show the proposed changes.

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.44%. Comparing base (e239e0c) to head (27e26dd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9628      +/-   ##
==========================================
- Coverage   88.45%   88.44%   -0.01%     
==========================================
  Files         422      422              
  Lines       14695    14691       -4     
  Branches     4298     4298              
==========================================
- Hits        12998    12994       -4     
  Misses       1372     1372              
  Partials      325      325              
Flag Coverage Δ
unittest 88.44% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ages/eslint-plugin/src/rules/no-unsafe-argument.ts 88.75% <100.00%> (-0.14%) ⬇️
...ackages/eslint-plugin/src/rules/prefer-includes.ts 98.87% <100.00%> (-0.02%) ⬇️
...plugin/src/rules/prefer-string-starts-ends-with.ts 97.43% <100.00%> (-0.02%) ⬇️
packages/type-utils/src/isUnsafeAssignment.ts 83.87% <100.00%> (-0.51%) ⬇️
packages/typescript-estree/src/node-utils.ts 51.34% <100.00%> (ø)

@@ -56,8 +56,7 @@ class FunctionSignature {
let restType: RestType | null = null;

const parameters = signature.getParameters();
for (let i = 0; i < parameters.length; i += 1) {
const param = parameters[i];
for (const [i, param] of parameters.entries()) {
Copy link
Member

Choose a reason for hiding this comment

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

Tim Gunn going 'eww' by sticking his tongue out and holding his hand up

// typescript array like elements have other iterable items
if (typeof index === 'number' && isRecord(arrayChild)) {
for (const [index, arrayChild] of child.entries()) {
if (isRecord(arrayChild)) {
Copy link
Member

Choose a reason for hiding this comment

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

Ok this one actually kind of makes sense IMO 😄

@JoshuaKGoldberg
Copy link
Member

Randy Jackson on American Idol going 'yeah that's going to be a no from me dawg'

@abrahamguo abrahamguo closed this Jul 28, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy