node-precinct icon indicating copy to clipboard operation
node-precinct copied to clipboard

Support customizing options for walker

Open fengzilong opened this issue 5 years ago • 2 comments

https://github.com/dependents/node-precinct/blob/860d577c2f444de6f6f731d879907c41958eea8a/index.js#L45

In my case, I would like to use a walker with custom options

var walker = new Walker( {
  plugins: [
    'flow',
    'classPrivateProperties',
    'nullishCoalescingOperator',
  ]
} )

how about adding walkerOptions in second parameter, e.g.

precinct( content, { walkerOptions: {} } )

and also thanks for your great work!

fengzilong avatar Jan 06 '20 12:01 fengzilong

Hey! Thanks for contributing. Feel free to open a PR with the change and a test. Sounds like a good point of extension. I'm happy to review contributions.

mrjoelkemp avatar Jan 13 '20 13:01 mrjoelkemp

I'll send a PR later~

fengzilong avatar Jan 14 '20 15:01 fengzilong