-
Notifications
You must be signed in to change notification settings - Fork 10
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
no-unused-expressions #32
Comments
严格来说,全局变量也有这种情况(比较少见): var obj = Object.defineProperty(window, 'prop', {
get() { /* 产生副作用 */ }
});
prop; // window.prop |
那就考虑采用「白名单」的方式,例如只修复 |
一般get函数是没有副作用的,所以移除掉的话也算合理。 |
what if |
The Once the improvement completed, some rules besides |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文档:https://eslint.org/docs/rules/no-unused-expressions
直接移除 node。
但如果子节点中包含
MemberExpression
,则不修复。因为会有以下情况:当然也不排除这个 fix 过于激进,所以也可以考虑不实现这个 fix。
The text was updated successfully, but these errors were encountered: