prettier-react-tachyons
prettier-react-tachyons copied to clipboard
Support typescript files
Related to #10.
This now works both on typescript and javascript files.
Had to use estree-to-babel because the typescript parser returns an estree, which babel doesn't like.
I also upgraded both prettier and babel-traverse, as a consequence node.value.extra.raw became node.value.raw.
This switches from the babylon parser to the typescript parser - while they both parse a specific subset of JavaScript, they don't accept the same inputs. I think this'll need to start exporting a languages array and having a different codepath for typescript vs javascript - assuming that it's possible to override default prettier parsers with plugins.
So you're thinking of converting this to a prettier-plugin- following that guide?
If I understood correctly the users will be able to do
yarn add --dev prettier-plugin-react-tachyons
instead of
{
"parser": "./node_modules/@observablehq/prettier-react-tachyons"
}
Will this work also in editors?