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
Rule proposal: prefer-textcontent
#156
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@issuehuntfest has funded $60.00 to this issue. See it on IssueHunt |
@sindresorhus I'm willing to work on this 👍Do you have a preferred way of determining we're in a browser? |
@alexzherdev has submitted a pull request. See it on IssueHunt |
There's no way to know that. We'll just have to assume |
Oh you're right, I confused with runtime detection 🤦♂️ |
@sindresorhus has rewarded $54.00 to @alexzherdev. See it on IssueHunt
|
Idea from: refined-github/refined-github#1088 (comment)
Prefer
node.textContent
overnode.innerText
.See: https://stackoverflow.com/a/35213639/64949
With ESLint, we can't know the type, but I guess we can safely assume
.innerText
refers to a DOM element, and if not, you can always disable it. Maybe it would be possible ifenv
isbrowser
and only validate then.Thoughts?
The text was updated successfully, but these errors were encountered: