-
-
Notifications
You must be signed in to change notification settings - Fork 353
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-node-remove
: Remove requirement for removeChild
to be on parentElement
or parentNode
#506
Comments
removeChild
to be on parentElement
or parentNode
prefer-node-remove
: Remove requirement for removeChild
to be on parentElement
or parentNode
Can you point me the line ? Can't find |
Sorry , I thought you are talking about Indeed, it seem unnessary, I think the old one mean to fix only Question is can |
Yes, I think it would be. And sometimes I even use |
Also I think old one allow |
I think it should be reported though since |
No this case is not what I mean , Literal cant pass argument check |
You're right, |
Ok, accepted. remove that check, PR welcome |
Other things to be done,
|
And I've added the callee type within the selector for |
I don't know if you want to crowd any more than one condition into the selectors, even though it appears possible per https://eslint.org/docs/developer-guide/selectors#restricting-syntax-with-selectors . |
for 2, About parentheses, I mean , And const array = []
foo.removeChild(await bar()) to const array = []
(await bar()).removeChild() still not right, this is right. (but we can forget about this, too hard) const array = []
;(await bar()).removeChild() |
I think only check |
@brettz9 I thought about this today again. The fix maybe more complicate, say we have this someDomLib('div')
.one()
.two()
.three()
.four()
.getParent() // do a lot of stuff , and return the parent at last
.removeChild(bar); I think we just fix it to bar.remove(); actually, we should do someDomLib('div')
.one()
.two()
.three()
.four()
.getParent(); // do a lot of stuff , and return the parent at last
bar.remove(); |
There is a requirement specific to
prefer-node-remove
which expects the parent to be named "parentNode" or "parentElement".There is no such requirement in
prefer-modern-dom-apis
withreplaceChild
orinsertBefore
, and I think there need be no such requirement.The text was updated successfully, but these errors were encountered: