syntax-tree / hast-util-to-estree

hast utility to transform to estree (JavaScript AST) JSX

Home Page:https://unifiedjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ability to customise handlers via options?

xiaoxinghu opened this issue · comments

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)

Subject

I would like to be able to customize (replacing existing and/or adding more) handlers via options.

Problem

I tried to use this module to parse my hast to estree, but I have something extra in my hast (via raw nodes) I would like to be able to deal with myself. It's easy to copy & paste code here into my project, but it'd be good to be able to leverage this module instead.

Solution

add handlers option in options and merge it with the default one.

Alternatives

Can't think of any good ones.

commented

Sounds good to me! Something like mdast-util-to-hast’s handlers? Can you work on a PR?

Sure, on it.

commented

Closed in #3, and released!