Open brodycj opened 4 years ago
related: https://github.com/prettier/prettier/issues/4424 - support library-specific plugin
quoting my comment in https://github.com/brodybits/prettierx/issues/8#issuecomment-468468549:
I think the ultimate design would be a pipeline-based toolset which uses the Acorn parser data structure, which seems to be how Babel JS works. I really like the general design of remark (https://remark.js.org/), which does Markdown processing in a set of plugins and is based on unifiedjs (https://unified.js.org/).
A step further may be to use a Flow Based Programming paradigm, like they did in
noflo/noflo-jekyll
(see this article and duplicate article on dzone).
src/language-js/printer-estree.js
seems to be a monolithic set of functions to format all possible elements of an estree that comes in some form from the parserI wonder if there could be a way to make this functionality more pluggable somehow, in a similar fashion to the way Babel and ESLint can work with parsing, analysis, and formatting plugins.
related (2021):
418 - VS Code support
8 - provide the additional formatting options in a Prettier plugin, which is now working in
prettier-plugin-x