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

fix(eslint-plugin): [prefer-nullish-coalescing] report on chain expressions in a ternary#10708

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

Conversation

OlivierZal
Copy link
Contributor

@OlivierZalOlivierZal commentedJan 24, 2025
edited
Loading

PR Checklist

Overview

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@OlivierZal!

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.

@netlifyNetlify
Copy link

netlifybot commentedJan 24, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commite800c2a
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67bc88d6a5dfdf0008d19711
😎 Deploy Previewhttps://deploy-preview-10708--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: 95 (🟢 up 22 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (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-cloudNx Cloud
Copy link

nx-cloudbot commentedJan 24, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit2c2f3ec.

CommandStatusDurationResult
nx run integration-tests:test❌ Failed2m 21sView ↗
nx test eslint-plugin --coverage=false✅ Succeeded6m 28sView ↗
nx test visitor-keys --coverage=false✅ Succeeded<1sView ↗
nx run types:build✅ Succeeded<1sView ↗
nx test utils --coverage=false✅ Succeeded<1sView ↗
nx run-many --target=build --exclude website --...✅ Succeeded19sView ↗
nx test typescript-eslint --coverage=false✅ Succeeded15sView ↗
nx test type-utils --coverage=false✅ Succeeded<1sView ↗
Additional runs (21)✅ Succeeded...View ↗

☁️Nx Cloud last updated this comment at2025-02-24 14:55:40 UTC

@OlivierZalOlivierZal changed the titleadd first tests (TDD)fix(eslint-plugin): [prefer-nullish-coalescing] doesn't report on chain expressions in a ternaryJan 24, 2025
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch from5c47f39 to2a49959CompareJanuary 24, 2025 10:33
@OlivierZalOlivierZal marked this pull request as draftJanuary 24, 2025 22:22
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch from2a49959 to629f39eCompareJanuary 24, 2025 22:34
@OlivierZalOlivierZal marked this pull request as ready for reviewJanuary 24, 2025 23:13
@codecovCodecov
Copy link

codecovbot commentedJan 24, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.30%. Comparing base(fa77b41) to head(e800c2a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@##             main   #10708   +/-   ##=======================================  Coverage   87.30%   87.30%           =======================================  Files         450      451    +1       Lines       15768    15768             Branches     4617     4616    -1     =======================================  Hits        13767    13767             Misses       1645     1645             Partials      356      356
FlagCoverage Δ
unittest87.30% <100.00%> (ø)

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

Files with missing linesCoverage Δ
...es/eslint-plugin/src/rules/no-floating-promises.ts98.58% <100.00%> (-0.02%)⬇️
...ges/eslint-plugin/src/rules/no-inferrable-types.ts98.27% <100.00%> (-0.03%)⬇️
packages/eslint-plugin/src/rules/prefer-find.ts100.00% <100.00%> (ø)
...lint-plugin/src/rules/prefer-nullish-coalescing.ts95.58% <100.00%> (+0.15%)⬆️
...t-plugin/src/rules/prefer-promise-reject-errors.ts100.00% <ø> (ø)
...plugin/src/rules/prefer-string-starts-ends-with.ts97.42% <100.00%> (-0.04%)⬇️
...ages/eslint-plugin/src/util/skipChainExpression.ts100.00% <100.00%> (ø)

@OlivierZalOlivierZal marked this pull request as draftJanuary 24, 2025 23:27
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch 3 times, most recently from03d4f65 toaa33e20CompareJanuary 26, 2025 00:40
@OlivierZalOlivierZal marked this pull request as ready for reviewJanuary 26, 2025 00:43
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch from0f54d68 tob2ce5f3CompareJanuary 27, 2025 08:43
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch from3c1a848 to4fba4b3CompareJanuary 28, 2025 20:06
@OlivierZalOlivierZal marked this pull request as draftFebruary 3, 2025 08:34
@OlivierZalOlivierZalforce-pushed theprefer-nullish-coalescing-10531 branch from4fba4b3 to5af7ed9CompareFebruary 4, 2025 14:27
@OlivierZalOlivierZal marked this pull request as ready for reviewFebruary 4, 2025 20:26
@OlivierZalOlivierZal marked this pull request as draftFebruary 4, 2025 20:27
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.

One pedantic complaint about naming but otherwise thumbs up 👍

OlivierZal reacted with thumbs up emoji
@OlivierZal
Copy link
ContributorAuthor

Fixed!

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.

Delightful. Thanks again!

OlivierZal reacted with heart emoji
@kirkwaiblingerkirkwaiblinger added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelFeb 20, 2025
@OlivierZal
Copy link
ContributorAuthor

OlivierZal commentedFeb 22, 2025
edited
Loading

I’m pretty sure the PR was green before Kirk’s approval, maybe I messed up when I created a new branch from this one… (although I didn’t add new code to this one).

@kirkwaiblinger
Copy link
Member

maybe try merging main and we'll see? There were some changes to CI recently

@OlivierZal
Copy link
ContributorAuthor

OlivierZal commentedFeb 22, 2025
edited
Loading

CI issue will be fixed by#10870

kirkwaiblinger reacted with thumbs up emoji

@OlivierZal
Copy link
ContributorAuthor

OlivierZal commentedFeb 24, 2025
edited
Loading

Seems there’s a failing snapshot onmain.

@JoshuaKGoldberg
Copy link
Member

Hoping to fix it with#10880. In the meantime, we're good to go here. ✅

OlivierZal reacted with heart emoji

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefix(eslint-plugin): [prefer-nullish-coalescing] doesn't report on chain expressions in a ternaryfix(eslint-plugin): [prefer-nullish-coalescing] report on chain expressions in a ternaryFeb 24, 2025
@JoshuaKGoldbergJoshuaKGoldberg merged commitf22de04 intotypescript-eslint:mainFeb 24, 2025
59 of 61 checks passed
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestFeb 26, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.25.0 || npm        | @typescript-eslint/parser        | 8.24.0 | 8.25.0 |## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)##### 🚀 Features-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))##### ❤️ Thank You-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)##### 🩹 Fixes-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))##### ❤️ Thank You-   Ronen Amiel-   YeonJuanYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestFeb 26, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.25.0 || npm        | @typescript-eslint/parser        | 8.24.0 | 8.25.0 |## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)##### 🚀 Features-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))##### ❤️ Thank You-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)##### 🩹 Fixes-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))##### ❤️ Thank You-   Ronen Amiel-   YeonJuanYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestMar 1, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.25.0 || npm        | @typescript-eslint/parser        | 8.24.0 | 8.25.0 |## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)##### 🚀 Features-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))##### ❤️ Thank You-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)##### 🩹 Fixes-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))##### ❤️ Thank You-   Ronen Amiel-   YeonJuanYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
renovatebot added a commit to andrei-picus-tink/auto-renovate that referenced this pull requestMar 2, 2025
| datasource | package                          | from   | to     || ---------- | -------------------------------- | ------ | ------ || npm        | @typescript-eslint/eslint-plugin | 8.24.0 | 8.25.0 || npm        | @typescript-eslint/parser        | 8.24.0 | 8.25.0 |## [v8.25.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8250-2025-02-24)##### 🚀 Features-   **eslint-plugin:** \[no-misused-spread] add suggestions ([#10719](typescript-eslint/typescript-eslint#10719))##### 🩹 Fixes-   **eslint-plugin:** \[prefer-nullish-coalescing] report on chain expressions in a ternary ([#10708](typescript-eslint/typescript-eslint#10708))-   **eslint-plugin:** \[no-deprecated] report usage of deprecated private identifiers ([#10844](typescript-eslint/typescript-eslint#10844))-   **eslint-plugin:** \[unified-signatures] handle getter-setter ([#10818](typescript-eslint/typescript-eslint#10818))##### ❤️ Thank You-   Olivier Zalmanski [@OlivierZal](https://github.com/OlivierZal)-   Ronen Amiel-   YeonJuan [@yeonjuan](https://github.com/yeonjuan)You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.## [v8.24.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8241-2025-02-17)##### 🩹 Fixes-   **eslint-plugin:** \[class-methods-use-this] check `accessor` methods with a function initializer ([#10796](typescript-eslint/typescript-eslint#10796))-   **eslint-plugin:** \[no-misused-promises] don't report on `static` `accessor` properties ([#10814](typescript-eslint/typescript-eslint#10814))-   **eslint-plugin:** \[no-deprecated] don't report on deprecated `accessor` property declaration ([#10813](typescript-eslint/typescript-eslint#10813))-   **eslint-plugin:** \[explicit-member-accessibility] check `accessor` class properties for missing accessibility modifier ([#10805](typescript-eslint/typescript-eslint#10805))-   **eslint-plugin:** \[explicit-module-boundary-types] check `accessor` class properties with a function initializer ([#10804](typescript-eslint/typescript-eslint#10804))-   **eslint-plugin:** \[prefer-return-this-type] check `accessor` properties with a function initializer ([#10794](typescript-eslint/typescript-eslint#10794))-   **eslint-plugin:** \[consistent-generic-constructors] check `accessor` class properties ([#10789](typescript-eslint/typescript-eslint#10789))-   **eslint-plugin:** \[no-unsafe-assignment] report on an `any` value assigned as an initializer of an `accessor` property ([#10785](typescript-eslint/typescript-eslint#10785))-   **eslint-plugin:** \[no-unnecessary-template-expression] ignore enum and enum members ([#10782](typescript-eslint/typescript-eslint#10782))-   **eslint-plugin:** \[no-inferrable-types] handle accessor ([#10780](typescript-eslint/typescript-eslint#10780))##### ❤️ Thank You-   Ronen Amiel-   YeonJuanYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kirkwaiblingerkirkwaiblingerkirkwaiblinger approved these changes

@JoshuaKGoldbergJoshuaKGoldbergAwaiting requested review from JoshuaKGoldberg

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [prefer-nullish-coalescing] doesn't report on chain expressions in a ternary
3 participants
@OlivierZal@kirkwaiblinger@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp