Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(
prefer-modern-dom-apis
): Ignore other cases where node return v…
…alue is used - Where parent is an `ArrayExpression`, `IfStatement`, `'MemberExpression`, `Property`, `ReturnStatement` Fixes a test which made a fix which would break because of an inability of the replacement API to return a value. Also provides minor optimization to avoid declaring fixer with value when not needed. Also applies (and for `prefer-node-*` rules, switches from) checking `ExpressionStatement` in favor of specific parents (BinaryExpression, CallExpression, ConditionalExpression, LogicalExpression, UnaryExpression), since in theory, the last part of `parentNode.insertBefore(alfa, beta).insertBefore(charlie, delta);` could be checked if the rule were changed to allow such parent expressions rather than requiring a parent member to be a name only (i.e., fixing `parentNode` in `parent.insertBefore()` but ignoring `some.expression().insertBefore()`) since technically such a replacement could be made.
- Loading branch information
Showing
3 changed files
with
78 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters