-
-
Notifications
You must be signed in to change notification settings - Fork 95
Support Prettier 1.6 Configurations #256
Comments
@k15a That's an interesting take, but I don't think it would be a desirable behavior for most people (could be wrong though). |
@robwise FYI there are a few regressions being reported on |
@darahak Roger that, will probably take me a little to get to this. We need to think about who wins if there is a conflict. Here's an example of what I mean (I bolded the one I think would win in the given scenario):
|
I don't know, now that I'm looking into it, I think it doesn't make sense for us to replicate all of the code that prettier already has inside of it when trying to determine how to format a file. We should just defer to the config if it exists. Here is what I'm proposing we do:
Then we'd just completely remove custom prettier settings from the Atom package's options (as well as the editorconfig integration and the "auto" tab width inference)? If you want to configure prettier, you should do it with a prettier config file and not the Atom package? We could also conceivably get rid of globs as well, we could just rely on the |
@robwise Sounds good. Not only because we avoid replicating code, but because it's what the users would expect. |
This is what the new settings pane could look like, obviously we are getting rid of a huge amount of options now that we expect you to handle things from prettierrc and prettierignore files: This might be controversial or it might not, I'm not sure. But my argument is that this would help to alleviate that flood of issues that turn out to be a misunderstanding of the complex logic going on. |
… settings where possible BREAKING CHANGE: Blacklist globs, whitelist globs, formatting options, parser-specific scopes, and editorconfig integration have all been removed. You can replace this functionality completely by adding a [Prettier configuration file](https://github.com/prettier/prettier#configuration-file) and/or a `.prettierignore` file. Resolves #256
^ I made a preliminary PR that implements what I outlined. If anyone reading this could use that branch in development mode for a while as they go about their day programming, it would be greatly appreciated. This way we can find any bugs and determine if we eliminated necessary functionality before we push it to everybody. |
@robwise Was getting rid of all Atom settings part of your initial proposal? I don't remember 😕 |
Oh, I edited it at some point to be more specific about what I meant, sorry that might have been after you replied. But no worries, that's why I didn't merge the PR or anything because I wasn't sure this was really the best way to go. I will add that other stuff back in. |
Hi, how would that work between the ESLint integration and the config file then? |
I just wanted to pipe in and say I would really appreciate this feature. The one compromise we had to make to get everyone working with prettier at work was to switch the Print Width to 100. That means when I switch between personal projects and work I need to open up the package settings and manually toggle it. (If anyone has a better workflow for me please message me! haha) |
I would just override that rule in your eslintconfig and you wouldn't really need a prettier config
We're working on it but I'm waiting on a new version of prettier to be released because the current version is async and I can't use async with Atom's format on save. |
Having a greater value in the ESLint config is desired to bring more flexibility, for instance long lines that can't break properly, that way you don't have to use disable comments all the time. Wouldn't it be possible to make the Prettier config prevail on anything? |
You'd have to make an issue/PR on prettier-eslint as that is handled under the hood by that tool, we just call out to it from prettier-atom and it reads the eslint config itself. |
Implemented in #261 |
Prettier 1.6 got released some hours ago and you can now configure Prettier per project. It would be great to support the configuration options with the Atom editor plugin.
In my mind the perfect use case would be:
Why?
If that's not possible it would still be great to support the project specific settings and .prettierignore.
What do you think?
The text was updated successfully, but these errors were encountered: