Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prettierx] provide the additional formatting options in a prettier plugin #8

Open
brody4hire opened this issue Jan 14, 2019 · 3 comments

Comments

@brody4hire
Copy link
Owner

as documented in https://prettier.io/docs/en/plugins.html#printers

This idea should make it easier to integrate with existing eslint plugins and other existing tools.

P.S. An interesting question on this subject asked in prettier/prettier#5747.

brody4hire referenced this issue in bangkokjs/prettierx-0.4.x-fork Jan 22, 2019
with the additional formatting options

as discussed in brody4hire/prettierx#37
brody4hire referenced this issue in bangkokjs/prettierx-0.4.x-fork Jan 22, 2019
- Add note that it is desired to provide the additional formatting
  options in a prettier plugin as discussed in brody4hire/prettierx#37

- Add phrase that brody4hire/prettierx#40 is resolved by
  brody4hire/prettierx#41 which is to be included by an upcoming merge.
@brody4hire brody4hire transferred this issue from bangkokjs/prettierx-0.4.x-fork Feb 24, 2019
@brody4hire
Copy link
Owner Author

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).

@brody4hire
Copy link
Owner Author

I made a couple of Prettier plugins that can use this formatter, with the new formatting options in this package from a configuration file:

Next step: support using Babel parser with TypeScript, as proposed in prettier/prettier#6400

I suggested in idea in prettier/prettier#6888 to support use of the standard (Microsoft) TypeScript implementation by moving it out to a plugin, rather than bundling it with Prettier itself. (As I said in #48, I do not bundle TypeScript parser with this package anymore.) Next step would be to demonstrate using Babel TypeScript parser from a plugin.

@brody4hire
Copy link
Owner Author

New Prettier plugin working with both Babel & TypeScript: https://github.com/brodybits/prettier-plugin-x

This project shows eslint, Prettier, eslint-config-standard for "Standard JS" formatting, and prettier-plugin-x with prettierx formatting options all working together: https://github.com/brodybits/react-native-module-init

Documentation needs to be updated.

brody4hire pushed a commit that referenced this issue Jun 23, 2021
* Language parsers are supported as if this were
  `prettier` version `1.15.3` / `1.16.0`;

* old language parsers are deprecated as if this were
  `prettier` version `1.15.3` / `1.16.0`.
brody4hire pushed a commit that referenced this issue Jun 23, 2021
(fix lint issue introduced in PR #8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant