-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update prettier to the latest version 🚀 #24
base: master
Are you sure you want to change the base?
Conversation
Version 1.8.1 just got published. |
Version 1.8.2 just got published. |
Version 1.9.0 just got published.Update to this version instead 🚀 Release Notes1.9.0: JSX Fragments, EditorConfig and Arrow ParensThis release adds an option for arrow function parens in arguments, support for the new JSX fragment syntax ( HighlightsJavaScriptOption to add parens in arrow function arguments (#3324) by @rattrayalex and @suchipiWhen printing arrow functions, Prettier omitted parens around the arguments if they weren’t strictly necessary, like so: // no parens foo => {}; This lead to the most commented thread in our issue tracker. Prettier now has the
JSX fragment syntax (#3237) by @duailibePrettier will now recognize and format JSX with the new fragment syntax, like the code below: function MyComponent() { return ( <> <Children1 /> <Children2 /> <Children3 /> </> ); } Fix slow formatting long texts in JSX (#3268, #3273) by @duailibeWe received feedback that formatting a JSX file with a really long text (~1000 lines) was really slow and noticed there was two performance bottlenecks in our MarkdownAdd an option to preserve text line breaks (#3340) by @ikatyangAfter the release of our Markdown support, we received feedback that breaking text to respect the print width could affect some renderers that could be sensitive to line breaks. In 1.8.2 we released a new option In 1.9 we are releasing a new option [WARNING] [BREAKING CHANGE] GraphQLSupport top-level interpolations (#3370) by @lydellWhen GraphQL support was released, Prettier did not support interpolation so it would skip formatting if any interpolations were present, because interpolations make formatting very difficult. While that works well for the most part, users of the Apollo Client were missing out on Prettier’s GraphQL support sometimes, because Apollo Client uses interpolation to share fragments between queries. The good news is that only top-level interpolations are allowed, and that was way easier to add support for in Prettier. In 1.9 we format GraphQL queries with top-level interpolation: gql` query User { user(id: "Bob") { ...UserDetails } } ${UserDetailsFragment} ` (Prettier will continue to skip formatting if the interpolation is inside a query or mutation or so.) Preserve intentional new lines in GraphQL (#3252) by @duailibePrettier will now respect intentional line breaks inside GraphQL queries (but limit to 1), where before it would remove them. query User { name CSSDon't lowercase element names and attribute names in selectors (#3317) by @lydellCSS is mostly case insensitive, so Prettier has been lowercasing stuff for a while to keep things consistent. Turns out we overlooked a detail in the CSS spec. Element and attribute names in selectors depend on the markup language: In HTML they are case insensitive, but in SVG (XML) they are not. Previously Prettier would incorrectly lowercase element and attribute names, but now we don’t anymore. ConfigurationAdd EditorConfig support (#3255) by @josephfrazierIt's taken a while, but Prettier will finally respect your
The Other changesJavaScriptDon't break simple elements in JSX (#3250) by @duailibePrettier won't break an element with no attributes anymore, keeping elements like Don't break identifiers inside template literals expressions (#3299) by @duailibeIn the previous release we tried a new strategy of breaking template literals with expressions inside to respect the print width. We've received feedback that for some cases it was actually preferred that it would exceed print width than breaking in multiple lines. From now on, template literals expressions that contain a single identifier won't break anymore: const foo = `Hello ${username}. Today is ${month} ${day}. You have ${newMessages} new messages`. Fix formatting of comment inside arrow function (#3334) by @jackyho112Fixes an edge case where Prettier was moving comments around breaking tools like Webpack: const API = { loader: () => import('./test' /* webpackChunkName: "test" */), }; Fix printing of comments around decorators and class properties (#3382) by @azzThere was a case where comments between a decorator and a class property were moved to an invalid position. // Before class Something { @decorator static // comment property = 1; } FlowDo not break on empty type parameters (#3281) by @vjeuxIt won't break empty type parameters ( Add support for flow mixins when using babylon (#3391) by @bakkotWe were accidentally dropping flow mixins, this has been fixed, but only for the // Before class Foo extends Bar {} TypeScriptDon't print a trailing comma after object rest spread (#3313) by @duailibeThis was inconsistent with JavaScript and Flow, Prettier won't print a trailing comma in the following cases, when using the TypeScript parser: const { bar, baz, ...rest } = foo; Print parens around type assertions for decorators (#3329) by @azzWe were omitting parens around type assertions inside decorators: @(bind as ClassDecorator) class Decorated {} MarkdownDon't break
|
Version 1.9.1 just got published. |
Version 1.9.2 just got published. |
Version 1.10.0 just got published.Update to this version instead 🚀 Release Notes1.10: One Year of Prettier 🎂 |
Version 1.10.1 just got published. |
Version 1.10.2 just got published. |
Version 1.11.0 just got published.Update to this version instead 🚀 Release NotesPrettier 1.11: CSS fixes and new TypeScript feature support |
Version 1.11.1 just got published. |
Version 1.12.0 just got published. |
Version 1.12.1 just got published. |
Version 1.13.0 just got published. |
Version 1.13.1 just got published. |
Version 1.13.2 just got published. |
Version 1.13.3 just got published. |
Version 1.13.4 just got published. |
Version 1.13.5 just got published. |
Version 1.13.6 just got published.Update to this version instead 🚀 Release Notes1.13.6 |
Version 1.13.7 just got published. |
Version 1.14.0 just got published.Update to this version instead 🚀 Release NotesPrettier 1.14: YAML Support |
Version 1.14.1 just got published.Update to this version instead 🚀 Release Notes1.14.1 |
Version 1.14.2 just got published.Update to this version instead 🚀 Release Notes1.14.2 |
Update to this version instead 🚀 Release Notes for 1.14.3 |
Update to this version instead 🚀 Release Notes for Prettier 1.15: HTML, Vue, Angular and MDX Support |
Update to this version instead 🚀 Release Notes for 1.15.1 |
Update to this version instead 🚀 Release Notes for 1.15.2 |
Version 1.8.0 of prettier was just published.
The version 1.8.0 is not covered by your current version range.
If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.
It might be worth looking into these changes and trying to get this project onto the latest version of prettier.
If you have a solid test suite and good coverage, a passing build is a strong indicator that you can take advantage of these changes directly by merging the proposed change into your project. If the build fails or you don’t have such unconditional trust in your tests, this branch is a great starting point for you to work on the update.
Release Notes
1.8.0: Markdown SupportThis release adds Markdown support, a new
--insert-pragma
flag, fixes a number of formatting issues, adds support for some new experimental operators, and improves our editor integration support.Highlights
Markdown Support
Support markdown (#2943) by @ikatyang
You can now run Prettier on Markdown files! 🎉
The implementation is highly compliant with the CommonMark spec, and backed by the excellent
remark-parse
package.Word Wrap
One of Prettier's core features is its ability to wrap code at a specified line length. This applies to Markdown too, which means you can maintain nice and clean 80-character-wide Markdown files without having to re-adjust line breaks manually when you add or delete words.
Input:
Output:
Code Formatting
Powered by Prettier's generic "multiparser", Prettier will format code blocks in Markdown! We use the language code provided with the code block to determine which language it is, and thus we can format any language that Prettier supports (including Markdown itself, if you're into that).
Input: