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

feat(eslint-plugin): specify which method is unbound and added test case #6281

Merged
merged 2 commits into from Dec 30, 2022

Conversation

cparros
Copy link
Contributor

@cparros cparros commented Dec 27, 2022

PR Checklist

Overview

Specified which destructured method is unbound and causing an error. Also added a test case for this in unbound-method.test.ts

@nx-cloud
Copy link

nx-cloud bot commented Dec 27, 2022

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @cparros!

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 Dec 27, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit f93b76e
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63ad3d624503990008c838f7
😎 Deploy Preview https://deploy-preview-6281--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.

@codecov
Copy link

codecov bot commented Dec 27, 2022

Codecov Report

Merging #6281 (f93b76e) into main (2d0a883) will increase coverage by 0.00%.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6281   +/-   ##
=======================================
  Coverage   91.26%   91.27%           
=======================================
  Files         366      366           
  Lines       12427    12445   +18     
  Branches     3639     3645    +6     
=======================================
+ Hits        11342    11359   +17     
+ Misses        774      772    -2     
- Partials      311      314    +3     
Flag Coverage Δ
unittest 91.27% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/unbound-method.ts 92.13% <ø> (ø)
...lugin-internal/src/rules/plugin-test-formatting.ts 79.76% <0.00%> (-1.16%) ⬇️
...es/eslint-plugin/src/rules/no-floating-promises.ts 100.00% <0.00%> (ø)
...slint-plugin/src/rules/no-unnecessary-condition.ts 98.33% <0.00%> (ø)
...lint-plugin/src/rules/prefer-nullish-coalescing.ts 100.00% <0.00%> (ø)
...es/eslint-plugin/src/util/getOperatorPrecedence.ts 42.85% <0.00%> (+2.85%) ⬆️

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.

Looks great! Just requesting a bit more testing ✨

errors: [
{
line: 7,
column: 9,
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add the endColumn here too? That way we know it's on the a, not a, b or some other odd range.

b: () => {},
};

const { a, b } = values;
Copy link
Member

Choose a reason for hiding this comment

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

A couple more test cases come to mind:

  • const { a: c } = values;
  • const { b, a } = values;

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Dec 27, 2022
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.

Super, thanks @cparros! Looks great. 🔥

@JoshuaKGoldberg JoshuaKGoldberg merged commit cf3ffdd into typescript-eslint:main Dec 30, 2022
tapanprakasht pushed a commit to tapanprakasht/typescript-eslint that referenced this pull request Dec 31, 2022
…ase (typescript-eslint#6281)

* Unbound-method test case added and specified error location

* test case update
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [unbound-method] Does not specify which destructured method is unbound
2 participants