eslint / espree

An Esprima-compatible JavaScript parser
BSD 2-Clause "Simplified" License
2.26k stars 189 forks source link

Increase the usage of compound assignment operators #526

Closed elfring closed 2 years ago

elfring commented 2 years ago

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of compound operators accordingly.

Would you like to integrate anything from a transformation result which can be generated by a command like the following? (:point_right: Please check also for questionable change suggestions because of an evolving search pattern.)

lokal$ perl -p -i.orig -0777 -e 's#\b(?<target>\S+)\s*=\s*\k<target>[ \t]*(?<operator>[+\-/%^]|\*\*?|&&?|\|\|?|\?\?|<<|>>>?)#$+{target} $+{operator}=#gm' $(find ~/Projekte/Espree/lokal -name '*.js')
nzakas commented 2 years ago

Closing due to age.

elfring commented 2 years ago

:crystal_ball: Will development interests eventually grow for the mentioned source code transformation approach?