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

feat(eslint-plugin): [prefer-nullish-coalescing] add support for assignment expressions#10152

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

abrahamguo
Copy link
Contributor

@abrahamguoabrahamguo commentedOct 15, 2024
edited
Loading

PR Checklist

Overview

Re-applies#5234, while accounting for updates made since toprefer-nullish-coalescing.

Commits:

@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.

@abrahamguoabrahamguo marked this pull request as draftOctober 15, 2024 12:19
@netlifyNetlify
Copy link

netlifybot commentedOct 15, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit22841da
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/671698d6a3b5760008057386
😎 Deploy Previewhttps://deploy-preview-10152--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: 97 (🟢 up 3 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 commentedOct 15, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit22841da. 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 2 targets

Sent with 💌 fromNxCloud.

@abrahamguoabrahamguoforce-pushed theprefer-nullish-coalescing-assignments branch from3dd873d to1e3281aCompareOctober 15, 2024 12:21
@abrahamguoabrahamguo marked this pull request as ready for reviewOctober 15, 2024 12:54
@abrahamguoabrahamguo changed the titlefix(eslint-plugin): [prefer-nullish-coalescing]fix(eslint-plugin): [prefer-nullish-coalescing]: add support for assignment expressionsOct 15, 2024
@abrahamguoabrahamguo changed the titlefix(eslint-plugin): [prefer-nullish-coalescing]: add support for assignment expressionsfeat(eslint-plugin): [prefer-nullish-coalescing]: add support for assignment expressionsOct 15, 2024
@abrahamguoabrahamguo changed the titlefeat(eslint-plugin): [prefer-nullish-coalescing]: add support for assignment expressionsfeat(eslint-plugin): [prefer-nullish-coalescing] add support for assignment expressionsOct 15, 2024
@codecovCodecov
Copy link

codecovbot commentedOct 16, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.16%. Comparing base(c8e7c27) to head(22841da).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #10152      +/-   ##==========================================- Coverage   86.18%   86.16%   -0.02%==========================================  Files         430      430                Lines       15029    15031       +2       Branches     4360     4361       +1     ==========================================- Hits        12952    12951       -1- Misses       1725     1728       +3  Partials      352      352
FlagCoverage Δ
unittest86.16% <100.00%> (-0.02%)⬇️

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

Files with missing linesCoverage Δ
...lint-plugin/src/rules/prefer-nullish-coalescing.ts97.70% <100.00%> (-2.30%)⬇️
packages/rule-tester/src/utils/config-validator.ts27.41% <100.00%> (ø)
packages/type-utils/src/TypeOrValueSpecifier.ts100.00% <ø> (ø)
packages/type-utils/src/builtinSymbolLikes.ts4.91% <ø> (ø)
.../src/typeOrValueSpecifiers/specifierNameMatches.ts100.00% <ø> (ø)

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.

Looks pretty reasonable! Requesting changes on keeping tests more precise. Thanks! ⚒️

@@ -171,7 +171,107 @@ export default createRule<Options, MessageIds>({
});
}

// todo: rename to something more specific?

Choose a reason for hiding this comment

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

todo

What's the resolution here? FWIW I don't mind the name as-is.

@@ -197,7 +197,7 @@ function validateConfigSchema(
config: TesterConfigWithDefaults,
source: string,
): void {
validateSchema||= ajv.compile(flatConfigSchema);
validateSchema??= ajv.compile(flatConfigSchema);

Choose a reason for hiding this comment

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

[Praise] Nice, a fix in the project itself!

@@ -30,31 +30,42 @@ const nullishTypes = ['null', 'undefined', 'null | undefined'];
const ignorablePrimitiveTypes = ['string', 'number', 'boolean', 'bigint'];

function typeValidTest(
cb: (type: string) => ValidTestCase<Options> | string,
cb: (type: string, equals: '' | '=') => ValidTestCase<Options> | string,

Choose a reason for hiding this comment

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

[Testing] We've been moving away from auto-generated tests. They tend to generate a huge spread of unit tests that each test ever so slightly different variations of the same thing. For example, this one now means each intricacy passed totypeValidTest is tested under both values ofequals.

IMO it'd be better to instead have specific targeted tests for each behavior under test.

Change request: revert any additions to these test generation functions, and instead write new tests manually.

@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelOct 21, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesOct 21, 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.

Oh LOL I did a brain fart, this is a re-application of changes. Got mixed up. LGTM, thanks!

@JoshuaKGoldberg
Copy link
Member

I'd switched fromconst tolet for consistency, I think. Not a major preference.

@JoshuaKGoldbergJoshuaKGoldberg removed the awaiting responseIssues waiting for a reply from the OP or another party labelOct 21, 2024
@JoshuaKGoldbergJoshuaKGoldberg merged commite765033 intotypescript-eslint:mainOct 21, 2024
63 of 64 checks passed
renovatebot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull requestOct 28, 2024
##### [v8.12.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8120-2024-10-28)##### 🚀 Features-   **eslint-plugin:** \[no-base-to-string] handle String() ([#10005](typescript-eslint/typescript-eslint#10005))-   **eslint-plugin:** \[switch-exhaustiveness-check] add allowDefaultCaseMatchUnionMember option ([#9954](typescript-eslint/typescript-eslint#9954))-   **eslint-plugin:** \[consistent-indexed-object-style] report mapped types ([#10160](typescript-eslint/typescript-eslint#10160))-   **eslint-plugin:** \[prefer-nullish-coalescing] add support for assignment expressions ([#10152](typescript-eslint/typescript-eslint#10152))##### ❤️  Thank You-   Abraham Guo-   Kim Sang Du [@developer-bandi](https://github.com/developer-bandi)-   Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)-   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.
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsOct 29, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg 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.

Bug: [prefer-nullish-coalescing] OR assignment operator(||=) does not report errors or suggest corrections.
2 participants
@abrahamguo@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp