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

An in-range update of prettier is breaking the build 🚨 #4

Open
greenkeeper bot opened this issue Sep 15, 2017 · 21 comments
Open

An in-range update of prettier is breaking the build 🚨 #4

greenkeeper bot opened this issue Sep 15, 2017 · 21 comments

Comments

@greenkeeper
Copy link
Contributor

greenkeeper bot commented Sep 15, 2017

Version 1.7.0 of prettier just got published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.6.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes 1.7.0: JSX tweaks, Pragma, TypeScript and CSS fixes

image

This release features some bugfixes and tweaks around JSX, TypeScript, CSS, and JavaScript formatting, as well as a couple new features.

Highlights

JSX Changes

We received a lot of community feedback about the changes we made to JSX formatting in the 1.6.0 release, and have made changes to bring formatting closer to community standards and expectations.

In 1.6.0, we added a second style for ternaries (conditional expressions, a ? b : c), based on a format popular in the community where parentheses are used to demarcate JSX content:

const DinnerOptions = ({ willEatMeat, willEatEggs, willEatVegetables }) => (
  <div>
    <div>Let's get some dinner...</div>
    {willEatMeat ? (
      <FullMenu />
    ) : willEatEggs ? (
      <VegetarianMenu />
    ) : willEatVegetables ? (
      <VeganMenu />
    ) : (
      <BackupMenu />
    )}
  </div>
);

Before this was added, prettier only formatted ternaries with one consistent style:

willEatMeat
  ? "Full Menu"
  : willEatEggs
    ? "Vegetarian Menu"
    : willEatVegetables ? "Vegan Menu" : "Backup Menu";

In 1.6.0, we used the following heuristic to decide when to use the new "JSX mode ternaries":

We should print a ternary using JSX mode if:
  * The ternary contains some JSX in it
  OR
  * The ternary appears inside of some JSX

However, this heuristic caused some unexpected formatting:
Github Diff showing a ternary containing internationalization strings appearing inside a JSX element being converted to use JSX-mode style ternaries

So, in 1.7.0, we have revised our heuristic to just be:

We should print a ternary using JSX mode if:
  * The ternary contains some JSX in it

We hope that this change will result in fewer surprising ternaries.

A big thanks goes out to @duailibe who implemented this change in addition to several other JSX-related formatting issues that were reported.

CSS Letter Case Consistency

We spent some time this release polishing our CSS formatting, and as part of that, @lydell did some work to normalize letter case.

So now, almost everything in CSS will print using lower case.

/* Before */
DIV.Foo {
  HEIGHT: 12PX;
}

/ After /
div.Foo {
height: 12px;
}

Don't worry, though – Prettier won't touch your $scss-variables, @less-variables, or FunctionNames(). Preprocess on!

Pragma Support

There is a new option called --require-pragma (requirePragma via the API) which will change prettier's behavior so that it only reformats a file if it has a special "pragma" comment at the top of it, that looks like this:

/**
 * @prettier
 */

or

/**
 * @format
 */

This was @ajhyndman's idea and it was implemented by @wbinnssmith.

Other Changes

TypeScript

There was a bug in Prettier 1.6.1 where an error would be thrown while parsing any TypeScript using the never type, for example:

Observable.empty<never>();

Also, Prettier 1.6.1 was incorrectly removing the declare keyword from enum declarations in *.d.ts files:

// In
declare const enum Foo {}

// Out
const enum Foo {}

Both of these issues have been fixed. Thanks to @JamesHenry and @existentialism for these fixes which support our TypeScript community!

Configuration

Configurable Config Precedence

There is a new CLI option --config-precedence which configures how prettier should prioritize config sources. Valid values are:

cli-override (default) - CLI options take precedence over config file

file-override - Config file take precedence over CLI options

prefer-file - If a config file is found will evaluate it and ignore other CLI options. If no config file is found CLI options will evaluate as normal.

This option adds support to editor integrations where users define their default configuration but want to respect project specific configuration.

prettier.resolveConfig.sync

Previously, there was no way via the API to resolve configuration for a source file synchronously. Thanks to some new additions to cosmiconfig by @sudo-suhas, @ikatyang was able to add support for this to the prettier API.

PRs merged in this release

Issues resolved in this release


Thank you to everyone who contributed to this release, be it through issue creation, code contribution, code review, or general commenting and feedback. Prettier is a community-run project and is able to continue to exist thanks to people like you. Thank you!

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Sep 15, 2017

After pinning to 1.6.1 your tests are passing again. Downgrade this dependency 📌.

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Sep 27, 2017

Version 1.7.1 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Sep 27, 2017

Version 1.7.2 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Sep 30, 2017

Version 1.7.3 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Oct 3, 2017

Version 1.7.4 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented May 27, 2018

Version 1.13.0 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented May 29, 2018

Version 1.13.1 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented May 29, 2018

Version 1.13.2 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jun 2, 2018

Version 1.13.3 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jun 2, 2018

Version 1.13.4 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jun 8, 2018

Version 1.13.5 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jun 25, 2018

Version 1.13.6 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

Release Notes 1.13.6

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jun 28, 2018

Version 1.13.7 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

Release Notes 1.13.7

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Jul 29, 2018

Version 1.14.0 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

Release Notes Prettier 1.14: YAML Support

🔗 Release Notes

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Aug 8, 2018

Version 1.14.1 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

Release Notes 1.14.1

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Aug 9, 2018

Version 1.14.2 just got published.

Your tests are passing again with this version. Explicitly upgrade to this version 🚀

Release Notes 1.14.2

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Sep 19, 2018

  • The dependency prettier was updated from 1.14.2 to 1.14.3.

Your tests are passing again with this update. Explicitly upgrade to this version 🚀

Release Notes for 1.14.3

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Nov 7, 2018

  • The dependency prettier was updated from 1.14.3 to 1.15.0.

Your tests are passing again with this update. Explicitly upgrade to this version 🚀

Release Notes for Prettier 1.15: HTML, Vue, Angular and MDX Support

🔗 Release Notes

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Nov 7, 2018

  • The dependency prettier was updated from 1.15.0 to 1.15.1.

Your tests are passing again with this update. Explicitly upgrade to this version 🚀

Release Notes for 1.15.1

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Nov 10, 2018

  • The dependency prettier was updated from 1.15.1 to 1.15.2.

Your tests are passing again with this update. Explicitly upgrade to this version 🚀

Release Notes for 1.15.2

🔗 Changelog

@greenkeeper
Copy link
Contributor Author

greenkeeper bot commented Nov 30, 2018

  • The dependency prettier was updated from 1.15.2 to 1.15.3.

Your tests are passing again with this update. Explicitly upgrade to this version 🚀

Release Notes for 1.15.3

🔗 Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants