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
Add prefer-array-includes
rule
#1062
Add prefer-array-includes
rule
#1062
Conversation
Add `prefer-array-includes` rule
Originally posted by @fisker in #1059 (comment) |
@Fabrice-TIERCELIN Have you seen this? And we can't copy so many lines from |
I will do this. |
I really don't understand what are you doing, these two points in this comment #1062 (comment), did you missed or is there something you don't understand? |
I don't have handled this yet. |
OK, so I have looked at ❌No common code: One rule analyzes the inner code of a function and the other rule analyzes the outter code around a function in order that they do not share any code. So they can't be merged. They can only be put together. ❌No big process: Although they produce the same result with the same function ✔️Simpler for the user: It's an "All in one" for the user. So when the user has to select the rules them wants, it's faster and simpler to choose. You can decide what you want. It's only a point of view. If you want me to merge the rules, I'm OK. It's up to you. Tell me what you want. |
Extract code from Call that function with different Do the same with tests(we don't even need write new tests, we can use the same one). |
Have you got a good code example? |
Do you want me do it? Won't take long. |
Either you give an example, or you do it. As you prefer. It will give me an example for the future features :) |
Check #1097 |
@Fabrice-TIERCELIN Better check commits one by one, you'll understand how it's done. |
Add
prefer-array-includes
ruleI didn't write the snapshot test as I don't know how to get the file
.js.snap
.Fixes #1058