Skip to content

Commit fde91b0

Browse files
andylovescodejessiejs
authored andcommitted
Meta: Add pluggability info to README
1 parent ffbc881 commit fde91b0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,17 @@ const { code, map } = print(ast, {
5757
// This only applies to string literals with no `raw` value, which generally
5858
// means the AST node was generated programmatically, rather than parsed
5959
// from an original source
60-
quotes: 'single'
60+
quotes: 'single',
61+
62+
// Overrwrite the inbuilt printers
63+
handlers: {
64+
...ecmascript, // It's best to include our default printers, esrap/modules/ecmascript
65+
...typescript, // The typescript module, if need be, esrap/modules/typescript,
66+
...jsx, // The JSX module, esrap/modules/jsx,
67+
CustomNode(node, state) {
68+
state.commands.push('this is custom') // see the source code in the inbuilt modules for examples on how to make your own
69+
}
70+
}
6171
});
6272
```
6373

0 commit comments

Comments
 (0)