Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: enable no-unreachable-loop#9540

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@abrahamguo
Copy link
Contributor

@abrahamguoabrahamguo commentedJul 11, 2024
edited
Loading

PR Checklist

Overview

Enableno-unreachable-loop (docs)

@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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedJul 11, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit8bf8fd3
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/669c1774f3b5d80008c88caa
😎 Deploy Previewhttps://deploy-preview-9540--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: 84 (🔴 down 10 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 yourNetlify site configuration.

@nx-cloud
Copy link

nx-cloudbot commentedJul 11, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit8bf8fd3. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@codecov
Copy link

codecovbot commentedJul 11, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.45%. Comparing base(5d895b7) to head(8bf8fd3).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #9540      +/-   ##==========================================- Coverage   88.45%   88.45%   -0.01%==========================================  Files         422      422                Lines       14694    14693       -1       Branches     4299     4299              ==========================================- Hits        12997    12996       -1  Misses       1372     1372                Partials      325      325
FlagCoverage Δ
unittest88.45% <100.00%> (-0.01%)⬇️

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

FilesCoverage Δ
packages/eslint-plugin/src/rules/no-mixed-enums.ts97.10% <100.00%> (-0.09%)⬇️
...ckages/eslint-plugin/src/rules/no-unsafe-return.ts96.77% <100.00%> (+0.05%)⬆️

return [] as any[];
}
`,
'const foo: (() => void) | undefined = () => 1;',
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

functionType.getCallSignatures() can return an empty array, but that code path was not being tested. This ensures that the code path is now covered.

kirkwaiblinger reacted with heart emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This was brought to light because when I initially refactored the rule to assume thatgetCallSignatures()[0] was always defined, the tests passed, but the rule crashed when linting this repo, therefore showing that a test was missing.

kirkwaiblinger reacted with thumbs up emoji
:AllowedType.Number;
}
}
const[{ initializer}]=(declarations[0]asts.EnumDeclaration)
Copy link
Member

Choose a reason for hiding this comment

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

Love this because this exposes a bug (not sure if it's intentional)! Checkingdeclarations[0] is almost always a bug.

kirkwaiblinger and JoshuaKGoldberg reacted with heart emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Is this truly a bug? Is it possible for a symbol to have multiple declarations, that would be different from each other?

Copy link
Member

Choose a reason for hiding this comment

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

No; if a symbol returns multiple declarations, that means these sites are merged together and should be treated as one. That's my understanding; I haven't verified it.

kirkwaiblinger
kirkwaiblinger previously approved these changesJul 13, 2024
Copy link
Member

@kirkwaiblingerkirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Appreciate you being proactive about adding that test 🙂

Josh-Cena
Josh-Cena previously approved these changesJul 19, 2024
kirkwaiblinger
kirkwaiblinger previously approved these changesJul 20, 2024
@JoshuaKGoldbergJoshuaKGoldberg changed the titlechore: enable no-unreachable-loopfix(eslint-plugin): correct no-unsafe-return call signatures by enabling no-unreachable-loop internallyJul 20, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesJul 20, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Achore so good, it got promoted to afix(eslint-plugin). Nice! 💪

@Josh-Cena
Copy link
Member

@JoshuaKGoldberg I don't think there are behavior differences with this PR? The logic of no-unsafe-return wasn't buggy, I think (well it could be, since only caring about the first signature still seems fishy).

@JoshuaKGoldberg
Copy link
Member

Oh, gotcha - I misinterpreted. Never mind then. 🙂

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefix(eslint-plugin): correct no-unsafe-return call signatures by enabling no-unreachable-loop internallychore: enable no-unreachable-loopJul 20, 2024
@Josh-CenaJosh-Cena dismissed stale reviews fromJoshuaKGoldberg,kirkwaiblinger, and themself via8bf8fd3July 20, 2024 20:00
@JoshuaKGoldbergJoshuaKGoldberg merged commit6647f7e intotypescript-eslint:mainJul 20, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJul 28, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@Josh-CenaJosh-CenaJosh-Cena approved these changes

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@kirkwaiblingerkirkwaiblingerkirkwaiblinger left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@abrahamguo@Josh-Cena@JoshuaKGoldberg@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp