Closed tquetano-netflix closed 5 years ago
@tquetano-netflix Sure, I have no objection with an option 👍 .
@oliviertassinari sweet, once I get a little time I'll throw a PR up.
Would #163 help?
EDIT: Wait I misread the PR you reference ... I think both are beneficial in slightly different ways. #163 allows for when createClass
is on the React
object, whereas my change allows for const createClass = require('create-react-class');
.
Currently, when using the legacy
create-react-class
package, this plugin will only apply code removal if the name of the method doing the creation iscreateReactClass
based on this line of source code, and this lines up with the documentation for React. That said, it should be fairly easy to allow configuration of this value by the options for the plugin (with the currentcreateReactClass
as default), and for our codebase where justcreateClass
is used this would save us a lot of reconciliation time.I can create a PR if you are open to this addition, this issue is just testing the waters in this regard.