Closed sergeyzwezdin closed 4 months ago
Try the babel-ts
parser instead?
import * as recast from "recast";
import * as ts from "recast/parsers/babel-ts";
console.log(
recast.parse(
`import {FC} from 'react';
export const Button: FC = () => {
return <div>button</div>;
}`,
{
parser: ts,
},
),
);
Trying to parse React (tsx) code, but
recast
fails with error.Does
recast
support React/TSX code parsing?