Skip to content

Add Elm plugin to website's home page - #4163

Merged
azz merged 3 commits into
prettier:masterfrom
kachkaev:patch-1
Mar 26, 2018
Merged

azz merged 3 commits into
prettier:masterfrom
kachkaev:patch-1

Conversation

@kachkaev

@kachkaev kachkaev commented Mar 16, 2018 •

Copy link
Copy Markdown
Member

Supplements #4161

Sorry for not doing all in one PR – I thought the website is build from a different repo. Can there be other lists of plugins that I have missed?

@duailibe

Copy link
Copy Markdown
Collaborator

I'm OK with this since it's under "Works with the tools you use" and that's a true statement.

But I'm worried people may think we're taking advantage of others' work and advertising as ours.

@kachkaev

Copy link
Copy Markdown
Member Author

If you are worried that elm plugin is just a wrapper for elm-format but it does not mention its core tool specifically, I don't think it's a problem. When someone clicks on Elm, the first thing they see is references to @avh4's elm-format and the emphasis of its dominant role in the plugin.

prettier-plugin-elm has some similarity with how markdown or python languages work in Prettier – both use external tools for parsing. The only difference is that Elm plugin also leverages elm-format's printer, which is one extra step.

@avh4 WDYT as the author of elm-format?

@alexander-akait

alexander-akait commented Mar 16, 2018 •

Copy link
Copy Markdown
Member

@kachkaev just for information, elm-format is support printWidth?

P.S. sorry for close 😄

@kachkaev

kachkaev commented Mar 16, 2018 •

Copy link
Copy Markdown
Member Author

@evilebottnawi nope, elm-format is 100% opinionated in everything and it does not support any config options 😃

Here is the output of elm-format --help for 0.6.1-alpha (latest):


Usage: elm-format [INPUT] [--output FILE] [--yes] [--validate] [--stdin]
                  [--elm-version VERSION] [--upgrade]
  Format Elm source files.

Available options:
  -h,--help                Show this help text
  --output FILE            Write output to FILE instead of overwriting the given
                           source file.
  --yes                    Reply 'yes' to all automated prompts.
  --validate               Check if files are formatted without changing them.
  --stdin                  Read from stdin, output to stdout.
  --elm-version VERSION    The Elm version of the source files being formatted.
                           Valid values: 0.16, 0.17, 0.18. Default: 0.18
  --upgrade                Upgrade older Elm files to Elm 0.18 syntax

Examples:
  elm-format Main.elm                     # formats Main.elm
  elm-format Main.elm --output Main2.elm  # formats Main.elm as Main2.elm
  elm-format src/                         # format all *.elm files in the src directory

Full guide to using elm-format at <https://github.com/avh4/elm-format>

Same set of options applies to 0.7.0-exp (experimental release).

Discussion of printWidth: avh4/elm-format#324

@alexander-akait

Copy link
Copy Markdown
Member

@kachkaev I think we should add new section (or add note before or after) for plugins which don't use logic of prettier but use api for DX.

@kachkaev

kachkaev commented Mar 16, 2018 •

Copy link
Copy Markdown
Member Author

That could be a good thing to add to the home page once there is at least one more plugin in this new list – otherwise it will look a bit odd. I'd also support splitting official plugins from the community ones, just like in plugins.html.

I think I understand what you mean by logic of prettier, but I'm not sure what its border is. OK, --print-width is a rather universal option, but what about --tab-width or --trailing-comma? It's quite likely that not all of the languages will be supporting all of such options even if some of them could fit the langauge. In this case, does a plugin follow the logic or not? What are the criteria?

@duailibe

duailibe commented Mar 16, 2018 •

Copy link
Copy Markdown
Collaborator

I think there's been a bit of confusion here :-)

My comment is only because the difference from the other plugins is they do use external tools but the core printing logic is implemented in the plugin, and not delegated to other tools; and has nothing to do with their use of Prettier's options.

I think it's great that the integration interface we created is being useful for languages that already have their own formatter. I was just worried that we need to make sure we're not advertising something we didn't create (it's also possible I'm worried for nothing and this is fine 😄)

@azz

azz commented Mar 25, 2018 •

Copy link
Copy Markdown
Member

Could we just make the list item say "Elm (via elm-format)"?

@kachkaev

Copy link
Copy Markdown
Member Author

@azz done!

@avh4

avh4 commented Mar 26, 2018

Copy link
Copy Markdown

elm-format author here. The latest patch looks good to me. (Though afaik, no other Elm formatters exist, so I doubt there would have been confusion in any case.)

@azz

azz commented Mar 26, 2018

Copy link
Copy Markdown
Member

image

LGTM

@azz
azz merged commit fb42862 into prettier:master Mar 26, 2018
@azz

azz commented Mar 26, 2018

Copy link
Copy Markdown
Member

We might eventually change it from "Work in Progress" to list them as "Plugins"

@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 5, 2018
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants