PageSourceSearch

https://prettier.netlify.app/assets/js/59570678.846d55a0.js

js prettier.netlify.app collected 2026-10-03 11:20:33 UTC 22,512 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["9615"],{3262(e,n,r){r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>c});var t=r(552),i=r(4848),s=r(8453);let o={authors:"sosukesuzuki",title:"Prettier 2.8: improve --cache CLI option and TypeScript 4.9 satisfies operator!"},l,a={authorsImageUrls:[void 0]},c=[{value:"Highlights",id:"highlights",level:2},{value:"TypeScript",id:"typescript",level:3},{value:"Support TypeScript 4.9 <code>satisfies</code> operator (#13764, #13783, #13872 by @sosukesuzuki)",id:"support-typescript-49-satisfies-operator-13764-13783-13872-by-sosukesuzuki",level:4},{value:"CLI",id:"cli",level:3},{value:"Do not save the cache if the <code>--write</code> option wasn&#39;t specified (#13016 by @Milly)",id:"do-not-save-the-cache-if-the---write-option-wasnt-specified-13016-by-milly",level:4},{value:"Add <code>--cache-location</code> option (#13019 by @sosukesuzuki)",id:"add---cache-location-option-13019-by-sosukesuzuki",level:4},{value:"Other Changes",id:"other-changes",level:2},{value:"JavaScript",id:"javascript",level:3},{value:"Fix docblock parsing (#13054 by @fisker)",id:"fix-docblock-parsing-13054-by-fisker",level:4},{value:"Fix range format for function bodies (#13173 by @thorn0)",id:"fix-range-format-for-function-bodies-13173-by-thorn0",level:4},{value:"Fix inconsistent formatting for multiline strings (#13274 by @GlebDolzhikov)",id:"fix-inconsistent-formatting-for-multiline-strings-13274-by-glebdolzhikov",level:4},{value:"TypeScript",id:"typescript-1",level:3},{value:"Fix parens in inferred function return types with <code>extends</code> (#13289 by @GlebDolzhikov)",id:"fix-parens-in-inferred-function-return-types-with-extends-13289-by-glebdolzhikov",level:4},{value:"CSS",id:"css",level:3},{value:"Fix formatting of long <code>:is</code>, <code>:where</code>, and <code>:not</code> selectors (#13577 by @j-f1)",id:"fix-formatting-of-long-is-where-and-not-selectors-13577-by-j-f1",level:4},{value:"SCSS",id:"scss",level:3},{value:"Fix: extra space between &#39;#&#39; and &#39;{&#39; (#13286 by @jspereiramoura)",id:"fix-extra-space-between--and--13286-by-jspereiramoura",level:4},{value:"Angular",id:"angular",level:3},{value:"Insert spaces in pipe (#13100 by @sosukesuzuki)",id:"insert-spaces-in-pipe-13100-by-sosukesuzuki",level:4},{value:"Ember / Handlebars",id:"ember--handlebars",level:3},{value:"Correctly format custom &quot;else if&quot; blocks (#13507 by @jamescdavis)",id:"correctly-format-custom-else-if-blocks-13507-by-jamescdavis",level:4},{value:"Markdown",id:"markdown",level:3},{value:"Preserve inline code line breaks if <code>--prose-wrap=preserve</code> (#11373 by @andersk)",id:"preserve-inline-code-line-breaks-if---prose-wrappreserve-11373-by-andersk",level:4},{value:"MDX",id:"mdx",level:3},{value:"Improve MDX range ignore support (#12208 by @nickrttn)",id:"improve-mdx-range-ignore-support-12208-by-nickrttn",level:4},{value:"API",id:"api",level:3},{value:"&quot;Doc Explorer&quot; mode for the Playground (#10183 by @thorn0)",id:"doc-explorer-mode-for-the-playground-10183-by-thorn0",level:4},{value:"Fix doc printer issue when using <code>ifBreak</code> inside <code>group</code> (#12362 by @fisker)",id:"fix-doc-printer-issue-when-using-ifbreak-inside-group-12362-by-fisker",level:4},{value:"&quot;Rethrow embed errors&quot; checkbox on the Playground (#13227 by @thorn0)",id:"rethrow-embed-errors-checkbox-on-the-playground-13227-by-thorn0",level:4},{value:"CLI",id:"cli-1",level:3},{value:"Infer parser for <code>.lintstagedrc</code> (#13081 by @OrRosenblatt)",id:"infer-parser-for-lintstagedrc-13081-by-orrosenblatt",level:4}];function d(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This release includes improvements to the ",(0,i.jsx)(n.code,{children:"--cache"})," option added in 2.7. A new ",(0,i.jsx)(n.code,{children:"--cache-location"})," option has been added, and a bug that saved the cache even when ",(0,i.jsx)(n.code,{children:"--write"})," wasn't specified has been fixed."]}),"\n",(0,i.jsxs)(n.p,{children:["We're also adding support for Type
1Script 4.9 ",(0,i.jsx)(n.code,{children:"satisfies"})," operator!"]}),"\n",(0,i.jsxs)(n.p,{children:["If you enjoy Prettier and would like to support our work, consider sponsoring us directly via ",(0,i.jsx)(n.a,{href:"https://opencollective.com/prettier",children:"our OpenCollective"})," or by sponsoring the projects we depend on, including ",(0,i.jsx)(n.a,{href:"https://opencollective.com/typescript-eslint",children:"typescript-eslint"}),", ",(0,i.jsx)(n.a,{href:"https://opencollective.com/unified",children:"remark"}),", and ",(0,i.jsx)(n.a,{href:"https://opencollective.com/babel",children:"Babel"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The Prettier team plans to release 3.0 within the next few months. If you are a plugin developer, get ready for the migration. Visit ",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/wiki/How-to-migrate-my-plugin-to-support-Prettier-v3%3F",children:"the migration guide"})," and issue ",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/issues/13616",children:"#13606"})," for more information."]}),"\n",(0,i.jsx)(n.h2,{id:"highlights",children:"Highlights"}),"\n",(0,i.jsx)(n.h3,{id:"typescript",children:"TypeScript"}),"\n",(0,i.jsxs)(n.h4,{id:"support-typescript-49-satisfies-operator-13764-13783-13872-by-sosukesuzuki",children:["Support TypeScript 4.9 ",(0,i.jsxs)(n.a,{href:"https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#satisfies",children:[(0,i.jsx)(n.code,{children:"satisfies"})," operator"]})," (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13764",children:"#13764"}),", ",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13783",children:"#13783"}),", ",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13872",children:"#13872"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/sosukesuzuki",children:"@sosukesuzuki"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-tsx",children:'const palette = {\n  red: [255, 0, 0],\n  green: "#00ff00",\n  blue: [0, 0, 255]\n} satisfies Record<Colors, string | RGB>;\n'})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes",children:"Auto-Accessors in Classes"})," will be supported in an upcoming 2.8 patch release. We have de-scoped them for now to ship ",(0,i.jsx)(n.code,{children:"satisfies"})," operator sooner."]}),"\n",(0,i.jsx)(n.h3,{id:"cli",children:"CLI"}),"\n",(0,i.jsxs)(n.h4,{id:"do-not-save-the-cache-if-the---write-option-wasnt-specified-13016-by-milly",children:["Do not save the cache if the ",(0,i.jsx)(n.code,{children:"--write"})," option wasn't specified (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13016",children:"#13016"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/Milly",children:"@Milly"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:'# Prettier 2.7\n$ prettier --cache foo.js\n# This shows formatted contents of `foo.js`.\n# Then cache is created and `foo.js` is flagged as already formatted.\n\n$ prettier --cache --write foo.js\nfoo.js 2ms (cached)\n# "... (cached)" means the file is already formatted, so nothing is done this time.\n\n# Prettier 2.8\n$ prettier --cache foo.js\n# Show formatted contents of `foo.js`.\n\n$ prettier --cache --write foo.js\nfoo.js 2ms\n# `foo.js` is formatted now.\n'})}),"\n",(0,i.jsxs)(n.h4,{id:"add---cache-location-option-13019-by-sosukesuzuki",children:["Add ",(0,i.jsx)(n.code,{children:"--cache-location"})," option (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13019",children:"#13019"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/sosukesuzuki",children:"@sosukesuzuki"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["By default, Prettier CLI saves the cache file for the ",(0,i.jsx)(n.code,{children:"--cache"})," option at ",(0,i.jsx)(n.code,{children:"./node_modules/.cache/prettier/.prettier-cache"}),". This can be overridden now:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"prettier --write --cache --cache-location=my_cache_file src\n"})}),"\n",(0,i.jsx)(n.h2,{id:"other-changes",children:"Other Changes"}),"\n",(0,i.jsx)(n.h3,{id:"javascript",children:"JavaScript"}),"\n",(0,i.jsxs)(n.h4,{id:"fix-docblock-parsing-13054-by-fisker",children:["Fix docblock parsing (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13054",children:"#13054"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/fisker",children:"@fisker"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:"// With `--insert-pragma` flag\n\n// Input\n/* comment */\nfoo()\n\n// Prettier 2.7\n/**\n * /* comment\n *\n * @format\n */\n\nfoo();\n\n// Prettier 2.8\n/**\n * comment\n *\n * @format\n */\n\nfoo();\n"})}),"\n",(0,i.jsxs)(n.h4,{id:"fix-range-format-for-function-bodies-13173-by-thorn0",children:["Fix range format for function bodies (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13173",children:"#13173"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/thorn0",children:"@thorn0"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:"// Input\nlet fn = (() =>
1 {\n  return; //\n//^^^^^^^^^^ - range\n});\n\n// Prettier 2.7\nlet fn = (() => {\n  return; //\n};);\n\n// Prettier 2.8\nlet fn = (() => {\n  return; //\n});\n"})}),"\n",(0,i.jsxs)(n.h4,{id:"fix-inconsistent-formatting-for-multiline-strings-13274-by-glebdolzhikov",children:["Fix inconsistent formatting for multiline strings (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13274",children:"#13274"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/GlebDolzhikov",children:"@GlebDolzhikov"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:'// Input\nconst loremIpsumFooBazBar1 = \'Multiline string\\\n         Multiline string\\\n\'\n\nconst loremIpsumFooBazBar2 = \'Multiline string\\\n         Multiline string\\\n         Multiline string\'\n\n// Prettier 2.7\nconst loremIpsumFooBazBar1 = "Multiline string\\\n         Multiline string\\\n";\n\nconst loremIpsumFooBazBar2 =\n  "Multiline string\\\n         Multiline string\\\n         Multiline string";\n\n// Prettier 2.8\nconst loremIpsumFooBazBar1 =\n  "Multiline string\\\n         Multiline string\\\n";\n\nconst loremIpsumFooBazBar2 =\n  "Multiline string\\\n         Multiline string\\\n         Multiline string";\n'})}),"\n",(0,i.jsx)(n.h3,{id:"typescript-1",children:"TypeScript"}),"\n",(0,i.jsxs)(n.h4,{id:"fix-parens-in-inferred-function-return-types-with-extends-13289-by-glebdolzhikov",children:["Fix parens in inferred function return types with ",(0,i.jsx)(n.code,{children:"extends"})," (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13289",children:"#13289"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/GlebDolzhikov",children:"@GlebDolzhikov"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"// Input\ntype Foo<T> = T extends (...a: any[]) => (infer R extends string) ? R : never;\n\n// Prettier 2.7\ntype Foo<T> = T extends (...a: any[]) => infer R extends string ? R : never;\n\n// Prettier 2.8\ntype Foo<T> = T extends ((...a: any[]) => infer R extends string) ? R : never;\n"})}),"\n",(0,i.jsx)(n.h3,{id:"css",children:"CSS"}),"\n",(0,i.jsxs)(n.h4,{id:"fix-formatting-of-long-is-where-and-not-selectors-13577-by-j-f1",children:["Fix formatting of long ",(0,i.jsx)(n.code,{children:":is"}),", ",(0,i.jsx)(n.code,{children:":where"}),", and ",(0,i.jsx)(n.code,{children:":not"})," selectors (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13577",children:"#13577"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/j-f1",children:"@j-f1"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["Pseudo-selectors like ",(0,i.jsx)(n.code,{children:":is"}),", ",(0,i.jsx)(n.code,{children:":where"}),", and ",(0,i.jsx)(n.code,{children:":not"})," that can take multiple selectors as arguments are now formatted like function calls are in other languages. Previously, no special significance was attached to the commas between their \u201Carguments,\u201D leading to confusing wrapping behavior. There are likely still improvements to be made here \u2014 please open an issue with some example code if you find something that doesn\u2019t look as expected."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"/* Input */\n:where(\n  label > input:valid,\n  label > textarea:not(:empty),\n  label > button[disabled]\n) ~ .errors > .error { display: none; }\n\n/* Prettier 2.7 */\n:where(label > input:valid, label > textarea:not(:empty), label\n    > button[disabled])\n  ~ .errors\n  > .error {\n  display: none;\n}\n\n/* Prettier 2.8 */\n:where(\n    label > input:valid,\n    label > textarea:not(:empty),\n    label > button[disabled]\n  )\n  ~ .errors\n  > .error {\n  display: none;\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"scss",children:"SCSS"}),"\n",(0,i.jsxs)(n.h4,{id:"fix-extra-space-between--and--13286-by-jspereiramoura",children:["Fix: extra space between '#' and '{' (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13286",children:"#13286"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/jspereiramoura",children:"@jspereiramoura"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scss",children:"// Input\npadding: var(--spacer#{(1) + 2});\n\n// Prettier 2.7\npadding: var(--spacer# {(1) + 2});\n\n// Prettier 2.8\npadding: var(--spacer#{(1) + 2});\n"})}),"\n",(0,i.jsx)(n.h3,{id:"angular",children:"Angular"}),"\n",(0,i.jsxs)(n.h4,{id:"insert-spaces-in-pipe-13100-by-sosukesuzuki",children:["Insert spaces in pipe (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13100",children:"#13100"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/sosukesuzuki",children:"@sosukesuzuki"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-html",children:'\x3c!-- Input --\x3e\n<tui-line-chart\n  [value]="chart | tuiFilter : f
1ilter : range | tuiMapper : toNumbers : range"\n></tui-line-chart>\n\n\x3c!-- Prettier 2.7 --\x3e\n<tui-line-chart\n  [value]="chart | tuiFilter: filter:range | tuiMapper: toNumbers:range"\n></tui-line-chart>\n\n\x3c!-- Prettier 2.8 --\x3e\n<tui-line-chart\n  [value]="chart | tuiFilter : filter : range | tuiMapper : toNumbers : range"\n></tui-line-chart>\n'})}),"\n",(0,i.jsx)(n.h3,{id:"ember--handlebars",children:"Ember / Handlebars"}),"\n",(0,i.jsxs)(n.h4,{id:"correctly-format-custom-else-if-blocks-13507-by-jamescdavis",children:['Correctly format custom "else if" blocks (',(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13507",children:"#13507"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/jamescdavis",children:"@jamescdavis"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["A template transform can be used to create custom block keywords that behave similar to ",(0,i.jsx)(n.code,{children:"if"}),'. This updates printer-glimmer to correctly recognize and format the "else if" case when "if" is a custom keyword.']}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-hbs",children:"{{! Input }}\n{{#when isAtWork}}\n  Ship that code!\n{{else when isReading}}\n  You can finish War and Peace eventually...\n{{else}}\n  Go to bed!\n{{/when}}\n\n{{! Prettier 2.7 }}\n{{#when isAtWork}}\n  Ship that code!\n{{else}}{{#when isReading}}\n    You can finish War and Peace eventually...\n  {{else}}\n    Go to bed!\n  {{/when}}{{/when}}\n\n{{! Prettier 2.8 }}\n{{#when isAtWork}}\n  Ship that code!\n{{else when isReading}}\n  You can finish War and Peace eventually...\n{{else}}\n  Go to bed!\n{{/when}}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"markdown",children:"Markdown"}),"\n",(0,i.jsxs)(n.h4,{id:"preserve-inline-code-line-breaks-if---prose-wrappreserve-11373-by-andersk",children:["Preserve inline code line breaks if ",(0,i.jsx)(n.code,{children:"--prose-wrap=preserve"})," (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/11373",children:"#11373"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/andersk",children:"@andersk"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-markdown",children:"\x3c!-- Input --\x3e\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor\nincididunt` ut labore et dolore magna aliqua.\n\n\x3c!-- Prettier 2.7 --\x3e\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor incididunt` ut labore et dolore magna aliqua.\n\n\x3c!-- Prettier 2.8 --\x3e\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor\nincididunt` ut labore et dolore magna aliqua.\n"})}),"\n",(0,i.jsx)(n.h3,{id:"mdx",children:"MDX"}),"\n",(0,i.jsxs)(n.h4,{id:"improve-mdx-range-ignore-support-12208-by-nickrttn",children:["Improve MDX range ignore support (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/12208",children:"#12208"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/nickrttn",children:"@nickrttn"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["Adds support for using Markdown ",(0,i.jsx)(n.a,{href:"https://prettier.io/docs/ignore#range-ignore",children:"range ignore"})," directives in MDX, using JSX comments."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-mdx",children:"// Input\n{/* prettier-ignore-start */}\n\nexport const Hello = () => {\n  return (<p>\n  Hello</p>)\n}\n\n{/* prettier-ignore-end */}\n\n// Prettier 2.7 (throws an error)\nTypeError: Cannot read properties of undefined (reading 'type')\n\n// Prettier 2.8\n{/* prettier-ignore-start */}\n\nexport const Hello = () => {\n  return (<p>\n  Hello</p>)\n}\n\n{/* prettier-ignore-end */}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"api",children:"API"}),"\n",(0,i.jsxs)(n.h4,{id:"doc-explorer-mode-for-the-playground-10183-by-thorn0",children:['"Doc Explorer" mode for the Playground (',(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/10183",children:"#10183"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/thorn0",children:"@thorn0"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["Switch the ",(0,i.jsx)(n.code,{children:"parser"})," option to the special ",(0,i.jsx)(n.code,{children:"doc-explorer"})," value to play with Prettier's intermediate representation and see how it's printed with different options."]}),"\n",(0,i.jsxs)(n.h4,{id:"fix-doc-printer-issue-when-using-ifbreak-inside-group-12362-by-fisker",children:["Fix doc printer issue when using ",(0,i.jsx)(n.code,{children:"ifBreak"})," inside ",(0,i.jsx)(n.code,{children:"group"})," (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/12362",children:"#12362"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/fisker",children:"@fisker"}),")"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",children:"// Input\n//                                                                              |80\nfor (const number of [123_123_123, 123_123_123, 123_123_123, 123_123_123, 12]) {\n}\n\n// Prettier 2.7\nfor (const number of [\n  123_123_123, 123_123_123, 123_123_123, 123_123_123, 12,\n]) {\n}\n\n// Prettier 2.8\nfor (const number of [123_123_123, 123_123_123, 123_123_123, 123_123_123, 12]) {\n}\n"})}),"\n",(0,i.jsxs)(n.h4,{id:"rethrow-embed-errors-checkbox-on-the-playground-13227-by-thorn0",children:['"Rethrow embed errors" checkbox on the Playground (',(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13227",children:"#13227"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/thorn0",children:"@thorn0"}),")"]}),"\n",(0,i.jsx)(n.p,{children:"Previously, the behavior of the Playground was confusingly inconsistent with the local behavior of Prettier in that it surfaced parsing errors in embedded languages for debug purposes. Now this behavior is controlled by a checkbox and disabled by default."}),"\n",(0,i.jsx)(n.h3,{id:"cli-1",children:"CLI"}
1),"\n",(0,i.jsxs)(n.h4,{id:"infer-parser-for-lintstagedrc-13081-by-orrosenblatt",children:["Infer parser for ",(0,i.jsx)(n.code,{children:".lintstagedrc"})," (",(0,i.jsx)(n.a,{href:"https://github.com/prettier/prettier/pull/13081",children:"#13081"})," by ",(0,i.jsx)(n.a,{href:"https://github.com/OrRosenblatt",children:"@OrRosenblatt"}),")"]}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:".lintstagedrc"})," file (without extension) is handled using ",(0,i.jsx)(n.code,{children:"json"})," and ",(0,i.jsx)(n.code,{children:"yaml"})," parsers."]})]})}function h(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453(e,n,r){r.d(n,{R:()=>o,x:()=>l});var t=r(6540);let i={},s=t.createContext(i);function o(e){let n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(s.Provider,{value:n},e.children)}},552(e){e.exports=JSON.parse('{"permalink":"/blog/2022/11/23/2.8.0","editUrl":"https://github.com/prettier/prettier/edit/main/website/blog/2022-11-23-2.8.0.md","source":"@site/blog/2022-11-23-2.8.0.md","title":"Prettier 2.8: improve --cache CLI option and TypeScript 4.9 satisfies operator!","description":"This release includes improvements to the --cache option added in 2.7. A new --cache-location option has been added, and a bug that saved the cache even when --write wasn\'t specified has been fixed.","date":"2022-11-23T00:00:00.000Z","tags":[],"readingTime":6.56,"hasTruncateMarker":true,"authors":[{"name":"Sosuke Suzuki","url":"https://github.com/sosukesuzuki","socials":{"x":"https://x.com/__sosukesuzuki","github":"https://github.com/sosukesuzuki"},"imageURL":"https://github.com/sosukesuzuki.png?size=58","key":"sosukesuzuki","page":null}],"frontMatter":{"authors":"sosukesuzuki","title":"Prettier 2.8: improve --cache CLI option and TypeScript 4.9 satisfies operator!"},"unlisted":false,"prevItem":{"title":"Prettier 3.0: Hello, ECMAScript Modules!","permalink":"/blog/2023/07/05/3.0.0"},"nextItem":{"title":"Prettier 2.7: new --cache CLI option and TypeScript 4.7 syntax!","permalink":"/blog/2022/06/14/2.7.0"}}')}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.