-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [no-array-delete] add rule #5852
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): [no-array-delete] add rule #5852
Conversation
I rewrite it again after one month, and i figured out that the last clone is outdated and i cloned the latest repo and just copied & pasted the file. Because of that there is no history available for this project.
Unnecessary Information Removed Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
Rule Is Now Off By Default Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
My bad!😱 Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
This option is unneeded because users can simply turn off the rule
Support for literal method names & better error message for computed and non-computed method names.
First commit before PR
Thanks for the PR, @mahdi-farnia! 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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5852 +/- ##
==========================================
+ Coverage 87.36% 87.41% +0.04%
==========================================
Files 386 387 +1
Lines 13190 13217 +27
Branches 3867 3870 +3
==========================================
+ Hits 11524 11553 +29
+ Misses 1300 1298 -2
Partials 366 366
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this in - I'm excited to see the no-array-delete
rule land soon*! 🙌
Requesting changes on some structural smoothing-out and more test cases, as well as splitting out the unrelated code into their own PRs.
Let me know if any of this is unclear - and thanks for working with us on it all @mahdi-farnia!
*sorry it took three weeks to get to the review 😬 - it should be sooner after this!
Ping @mahdi-farnia - is this still something you have time to work on? No worries if not, just checking in - thanks! |
Hi, Mmm... No nothing left hear. That should be done in a few minutes...👍 |
@mahdi-farnia I normally wait till folks re-request review - but it looks like this might be ready for review. Do you want me to take another look? 🙂 |
Omg, I thought i should wait till you review them and not to mention you again. 🫤 Yes, please 😄 |
The lint problem resolved, that was due to uninstalled (i don't know why) package eslint-plugin-unicorn. |
by split if conditions Co-authored-by: Armano <armano2@users.noreply.github.com>
remove extra if statement
@armano2 thank you so much. your review saved a review and an edit by me. |
Actually this is my first serious contribution to an open-source project. If you see something strange in my code or something that experts don't do in their code, please don't blame me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Looks great - very close to merge I think! I did a closer pass and think it's just a few small-ish things blocking review now. Mostly the bug around suggestions.
Seems this path is too long 😄 I'll apply suggested changes in the next weekend... (or as soon as I can) |
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
apply suggested changes
After all, please help me resolving conflicts with |
You should be able to run the command mentioned at the top of the file:
My typical strategy for autogenerated files that are giving me Git merge woes is:
Does that help? |
👋 Hey @mahdi-farnia! Just checking in, is this still something you have time for? No worries if not - I just don't want to leave it hanging. |
I was waiting for you :) (i requested a review) |
Ah, I was under the impression you were waiting for help on resolving the merge conflict with |
delete multiDimesnional[i][i][i][i][i].someProp; | ||
`, | ||
], | ||
invalid: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more test cases off the top of my head:
ReadonlyArray<...>
readonly ...[]
Readonly<...[]>
Readonly<Array<...>>
import { unionTypeParts } from 'tsutils'; | ||
import * as ts from 'typescript'; | ||
|
||
import * as util from '../util'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
util should probably be switched to named imports
Sorry for late response. I am busy these days. I'll apply every requested changes as soon as I touch my computer. 🙂 |
@mahdi-farnia since it's been a month I'm going to go ahead and close this PR to keep our queue small. Totally understand not having time for this - thanks for all the work you did to get it started! If you end up having time to pick it back up, feel free to send a new PR (or re-open this one if it hasn't been auto-locked). If anybody else ends up wanting to take on these changes in the interim, please do add a co-author attribution if you use any code from this PR. Thanks! |
PR Checklist
Overview
Before:
Using
delete
operator for arrays in JavaScript leaves an empty value & unchanged length property as the actual index is not deleted, Just its value replaced by empty.After:
Closes #4432