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

fix(eslint-plugin): [no-extra-parens] false positive when used with satisfies keyword #7026

Closed

Conversation

fcorsair
Copy link

PR Checklist

Overview

Added new condition inside MemberExpression type rule for SatisfiesExpression node type, added new simple test.

This is my first PR, be kind 😄 ❤️

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @fcorsair!

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.

@netlify
Copy link

netlify bot commented May 12, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit be84387
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/645ecd220687e60008c3a4b6
😎 Deploy Preview https://deploy-preview-7026--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@fcorsair fcorsair changed the title fix(eslin-plugin): [no-extra-parens] false positive when used with satisfies keyword fix(eslint-plugin): [no-extra-parens] false positive when used with satisfies keyword May 12, 2023
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

A good start, thanks for sending this in! 🙌

Requesting changes for increased test coverage. This stuff can get tricky! I'd suggest seeing the discussion in #6885 to check if there's some shared logic that should be updated. I can review more deeply once there are more test cases.

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label May 12, 2023
@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #7026 (be84387) into main (a6f23a2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7026   +/-   ##
=======================================
  Coverage   87.38%   87.38%           
=======================================
  Files         386      386           
  Lines       13193    13195    +2     
  Branches     3867     3868    +1     
=======================================
+ Hits        11529    11531    +2     
  Misses       1298     1298           
  Partials      366      366           
Flag Coverage Δ
unittest 87.38% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/no-extra-parens.ts 91.66% <100.00%> (+0.20%) ⬆️

@xsjcTony

This comment was marked as spam.

@bradzacher bradzacher added the bug Something isn't working label Jul 17, 2023
@@ -242,6 +242,11 @@ f<(number | string)[]>(['a', 1])
},
},
}),
{
code: `
const a = (['a', 'b'] satisfies A[]).includes('a');
Copy link
Member

Choose a reason for hiding this comment

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

Recreating a new thread from https://github.com/typescript-eslint/typescript-eslint/pull/7026/files#r1192868544: shouldn't this still cause a rule report?

const a = ((['a', 'b'] satisfies A[])).includes('a');

Note the extra parenthesis around the (['a', 'b'] satisfies A[]).

Copy link
Author

Choose a reason for hiding this comment

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

sure, this case definitely deserves a test

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Sorry if I was unclear on this one - the code looks nice in general, but I think there's a missing test case that fails locally for me?

@JoshuaKGoldberg
Copy link
Member

Ping @fcorsair, is this still something you have time & interest for?

@fcorsair
Copy link
Author

fcorsair commented Sep 4, 2023

Ping @fcorsair, is this still something you have time & interest for?

yes, I would like to complete this PR, I've been a little busy in the last months

@JoshuaKGoldberg
Copy link
Member

Closing this PR as it's been stale for ~6 weeks without activity. Feel free to reopen @fcorsair if you have time - but no worries if not! If anybody wants to drive it forward, please do post your own PR - and if you use this as a start, consider adding Co-authored-by: @fcorsair at the end of your PR description. Thanks! 😊

@JoshuaKGoldberg JoshuaKGoldberg added the stale PRs or Issues that are at risk of being or have been closed due to inactivity for a prolonged period label Oct 18, 2023
@fcorsair
Copy link
Author

fcorsair commented Oct 18, 2023

Hi @JoshuaKGoldberg I don’t get from the issue discussion if the problem should be now fixed from latest eslint versions or still not. Do you confirm it?

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Oct 19, 2023

I'm not sure what you mean, but if there's a bug in typescript-eslint with an equivalent that was fixed in ESLint core we can always take an issue.

@fcorsair
Copy link
Author

fcorsair commented Oct 19, 2023

I'm not sure what you mean, but if there's a bug in typescript-eslint with an equivalent that was fixed in ESLint core we can always take an issue.

Ok now I get it, it’s fixed in eslint only, still bugged in ts-eslint

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party bug Something isn't working stale PRs or Issues that are at risk of being or have been closed due to inactivity for a prolonged period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [no-extra-parens] False positive when used with satisfies keyword
4 participants