-
Notifications
You must be signed in to change notification settings - Fork 147
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
prefer-find-by autofix doesn't respect extra code #579
Comments
I started looking into this, and... I think that this issue's options part might be unnecessary 😅 Yes, the options?: {
container?: HTMLElement
timeout?: number
interval?: number
onTimeout?: (error: Error) => Error
mutationObserverOptions?: MutationObserverInit
} However, the different queries ( options?: {
exact?: boolean = true,
normalizer?: NormalizerFn,
} Our unit tests for |
That's right, but this is referring to
So based on this, we should keep the options found in the |
Additionally, this issue describes another issue when the |
Aaah, thank you for clarifying @Belco90! I learned something new today 🔖 🤗 Then this issue is totally valid, and I know how to fix the options part! |
@sjarva that's amazing! Thanks for your efforts! |
Okay, #679 fixes the part/scenario 1 of this issue. I'll continue working on the second part too, so I'm assigning this to myself. |
Relates to #579 * fix(docs): mark code keywords with `` and add a period to end of sentence * fix(prefer-find-by): autofixer now transfers waitFor options to autofixed
Reopening since only the first half is done (GitHub automation closed it, my bad). |
@sjarva Any movement on the second part? This bit me at work today - especially after I just got done convincing my team that they should be writing |
Thanks for asking @reinrl. Anything didn't happen before you asked, but I took some time to continue this during the weekend and I have some more questions. Pinging @Belco90 for answers and brainstorming 😅
Our rule documentation says:
Should this be updated also?
@reinrl's examples are about queries that have
I'm guessing that the answer to both questions is yes, but asking to prevent this discussion on the actual PR itself. |
I am also seeing the same issue where assertions are removed, when letting auto fix run: From this:
To this:
|
Plugin version
v5.3.1
ESLint version
v8.14.0
Node.js version
v16.3.0
npm/yarn version
npm v8.9.0
Operating system
macOS v12.3.1
Bug description
The autofix of the rule
prefer-find-by
doesn't work correctly whenwaitFor
options are provided, or there is an assertion involved.Steps to reproduce
Error output/screenshots
These are fixed as:
ESLint configuration
N/A
Rule(s) affected
prefer-find-by
Anything else?
They should be fixed as:
Do you want to submit a pull request to fix this bug?
Yes
The text was updated successfully, but these errors were encountered: