diff --git a/.eslintrc.yml b/.eslintrc.yml index ae99a744e..6ac823ea0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -13,7 +13,9 @@ plugins: settings: import/internal-regex: ^linguist-languages/ rules: - prettier-internal-rules/require-json-extensions: error + arrow-body-style: + - error + - as-needed curly: error dot-notation: error eqeqeq: @@ -52,6 +54,8 @@ rules: prefer-object-spread: error prefer-rest-params: error prefer-spread: error + prettier-internal-rules/jsx-identifier-case: error + prettier-internal-rules/require-json-extensions: error quotes: - error - double @@ -63,9 +67,11 @@ rules: - never - exceptRange: true unicorn/better-regex: error + unicorn/explicit-length-check: error unicorn/new-for-builtins: error unicorn/no-useless-undefined: error unicorn/prefer-includes: error + unicorn/prefer-number-properties: error unicorn/prefer-string-slice: error overrides: - files: @@ -104,9 +110,26 @@ overrides: prettier-internal-rules/better-parent-property-check-in-needs-parens: error - files: src/**/*.js rules: + prettier-internal-rules/no-doc-builder-concat: error prettier-internal-rules/prefer-fast-path-each: error + prettier-internal-rules/prefer-is-non-empty-array: error + - files: src/document/*.js + rules: + prettier-internal-rules/no-doc-builder-concat: off - files: - - src/language-js/**/*.js - - src/language-css/**/*.js + - src/language-*/**/*.js rules: prettier-internal-rules/directly-loc-start-end: error + - files: + - src/language-js/**/*.js + rules: + prettier-internal-rules/no-node-comments: + - error + - file: "src/language-js/utils.js" + functions: + - hasComment + - getComments + - "src/language-js/parse-postprocess.js" + - "src/language-js/parser-babel.js" + - "src/language-js/parser-meriyah.js" + - "src/language-js/pragma.js" diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 6dba27551..85040b22c 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,6 +5,10 @@ # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt # Prettier bump after release +# 2.2.1 +80961835a68e3de1b14819a7b77583a54d2b63d7 +# 2.2.0 +cf354c205de9841a2d306387473dac369359ca2b # 2.1.2 c4d3014b95122f4ad19c319a9b3f5f9625d6003f # 2.1.1 diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index ba91ba43f..76c445afc 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Tip! Don't write this stuff manually. --> -**Prettier 2.1.2** +**Prettier 2.2.1** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 73e97d703..d443f6cbf 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.1.2 +- Prettier Version: 2.2.1 - Running Prettier via: - Runtime: - Operating System: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6ef9e89f7..4f0d98099 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,17 @@ +## Description + +## Checklist + - [ ] I’ve added tests to confirm my change works. -- [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the `docs/` directory) -- [ ] (If the change is user-facing) I’ve added my changes to `changelog_unreleased/*/pr-XXXX.md` file following `changelog_unreleased/TEMPLATE.md`. +- [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the `docs/` directory). +- [ ] (If the change is user-facing) I’ve added my changes to `changelog_unreleased/*/XXXX.md` file following `changelog_unreleased/TEMPLATE.md`. - [ ] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md). + + **✨[Try the playground for this PR](https://prettier.io/playground-redirect)✨** diff --git a/.github/workflows/dev-package-test.yml b/.github/workflows/dev-package-test.yml index 12576bc08..b65f53b10 100644 --- a/.github/workflows/dev-package-test.yml +++ b/.github/workflows/dev-package-test.yml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 243674207..f14544514 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 with: node-version: ${{ matrix.node }} @@ -63,7 +63,7 @@ jobs: run: yarn test --maxWorkers=2 - name: Upload Coverage - uses: codecov/codecov-action@v1.0.14 + uses: codecov/codecov-action@v1.2.1 if: matrix.ENABLE_CODE_COVERAGE with: token: ${{ secrets.CODECOV_TOKEN }} @@ -77,7 +77,7 @@ jobs: PRETTIER_FALLBACK_RESOLVE: true - name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE) - uses: codecov/codecov-action@v1.0.14 + uses: codecov/codecov-action@v1.2.1 if: matrix.ENABLE_CODE_COVERAGE with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/eslint-rules.yml b/.github/workflows/eslint-rules.yml new file mode 100644 index 000000000..75b183a46 --- /dev/null +++ b/.github/workflows/eslint-rules.yml @@ -0,0 +1,28 @@ +name: Internal_ESLint_Rules_Test + +on: + push: + paths: + - "scripts/tools/eslint-plugin-prettier-internal-rules" + - ".github/workflows/eslint-rules.yml" + pull_request: + paths: + - "scripts/tools/eslint-plugin-prettier-internal-rules" + - ".github/workflows/eslint-rules.yml" + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + + - name: Setup Node.js + uses: actions/setup-node@v2.1.4 + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Test + run: cd scripts/tools/eslint-plugin-prettier-internal-rules && yarn test-coverage diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bfbb606ef..685b7f15b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 - name: Install Dependencies run: yarn install --frozen-lockfile diff --git a/.github/workflows/prod-test.yml b/.github/workflows/prod-test.yml index bd3be0d02..699d5f2d8 100644 --- a/.github/workflows/prod-test.yml +++ b/.github/workflows/prod-test.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 - name: Install Dependencies run: yarn install --frozen-lockfile @@ -47,7 +47,7 @@ jobs: # The cache step might saving the result of master branch, need investigate - name: Check Sizes if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/npm_and_yarn/') - uses: preactjs/compressed-size-action@v2.0.1 + uses: preactjs/compressed-size-action@2.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" compression: none @@ -61,7 +61,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 - name: Install Dependencies run: yarn install --frozen-lockfile @@ -109,7 +109,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Setup Node.js - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v2.1.4 with: node-version: ${{ matrix.node }} diff --git a/.gitignore b/.gitignore index 1a0eb682a..cdee460be 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ package-lock.json !.yarn/sdks !.yarn/versions .pnp.* +.nyc_output +/scripts/tools/eslint-plugin-prettier-internal-rules/node_modules diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ac74494a2..510d631cb 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,4 +1,7 @@ +# Remove this file after year 2020 + - id: prettier name: prettier - entry: prettier --write --list-different --ignore-unknown - language: node + entry: Prettier support for pre-commit has been moved to https://github.com/pre-commit/mirrors-prettier, please use the new repository. + language: fail + pass_filenames: false diff --git a/.prettierrc b/.prettierrc index 0967ef424..7c80702fa 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1,7 @@ -{} +overrides: + - files: "**/*.{js,mjs}" + options: + parser: meriyah + - files: ".prettierrc" + options: + parser: yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6270e1b7c..49b08b329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +# 2.2.1 + +[diff](https://github.com/prettier/prettier/compare/2.2.0...2.2.1) + +#### Fix formatting for AssignmentExpression with ClassExpression ([#9741](https://github.com/prettier/prettier/pull/9741) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + + +```js +// Input +module.exports = class A extends B { + method() { + console.log("foo"); + } +}; + +// Prettier 2.2.0 +module.exports = class A extends ( + B +) { + method() { + console.log("foo"); + } +}; + +// Prettier 2.2.1 +module.exports = class A extends B { + method() { + console.log("foo"); + } +}; +``` + +# 2.2.0 + +[diff](https://github.com/prettier/prettier/compare/2.1.2...2.2.0) + +🔗 [Release Notes](https://prettier.io/blog/2020/11/20/2.2.0.html) + # 2.1.2 [diff](https://github.com/prettier/prettier/compare/2.1.1...2.1.2) diff --git a/changelog_unreleased/blog-post-intro.md b/changelog_unreleased/BLOG_POST_INTRO_TEMPLATE.md similarity index 100% rename from changelog_unreleased/blog-post-intro.md rename to changelog_unreleased/BLOG_POST_INTRO_TEMPLATE.md diff --git a/changelog_unreleased/TEMPLATE.md b/changelog_unreleased/TEMPLATE.md index 4700d04e1..4e961c104 100644 --- a/changelog_unreleased/TEMPLATE.md +++ b/changelog_unreleased/TEMPLATE.md @@ -6,7 +6,7 @@ - For TypeScript specific syntax, choose `typescript/`. - If your PR applies to multiple languages, such as TypeScript/Flow, choose one folder and mention which languages it applies to. -2. In your chosen folder, create a file with your PR number: `pr-XXXX.md`. For example: `typescript/pr-6728.md`. +2. In your chosen folder, create a file with your PR number: `XXXX.md`. For example: `typescript/6728.md`. 3. Copy the content below and paste it in your new file. diff --git a/changelog_unreleased/api/8105.md b/changelog_unreleased/api/8105.md new file mode 100644 index 000000000..715e6a7e6 --- /dev/null +++ b/changelog_unreleased/api/8105.md @@ -0,0 +1,3 @@ +#### Treat `.prettierrc` as `yaml` (#8105 by @fisker) + +`.prettierrc` file can written in both JSON and YAML, previously we infer the parser to be `json`, if it's write in YAML, there will be a `SyntaxError` thrown when formatting it, now it's treat as a YAML file, but if it's write in JSON, it won't format as a normal YAML file, it will be formatted as JSON. diff --git a/changelog_unreleased/api/9733.md b/changelog_unreleased/api/9733.md new file mode 100644 index 000000000..0c903d057 --- /dev/null +++ b/changelog_unreleased/api/9733.md @@ -0,0 +1,13 @@ +#### Use arrays instead of `concat` (#9733 by @fisker, @thorn0) + +To simplify the code of AST printers, the data structure for the concatenation command has been changed from `{ type: 'concat', parts: Doc[] }` to `Doc[]`. The old format is deprecated, but for compatibility, the doc printer still supports it, and `doc.builders.concat` (as well as some other builder functions) will keep using it until the next major version of Prettier. + +If you're a plugin author, this change should only concern you if your plugin introspects or modifies composed docs. If it happens to be the case, please make your plugin compatible with future versions of Prettier by tweaking the introspecting code to support the new format. There also is an off-chance where this change can break things, namely if a plugin calls another plugin to [print an embedded language](https://prettier.io/docs/en/plugins.html#optional-embed) and then introspects the returned doc. There seems to be no reason for plugins to do that though. + +```jsx +// Prettier stable +myDoc = group(concat(["foo", line, "bar"])); + +// Prettier master +myDoc = group(["foo", line, "bar"]); +``` diff --git a/changelog_unreleased/api/pr-8983.md b/changelog_unreleased/api/pr-8983.md deleted file mode 100644 index 4282ea7a0..000000000 --- a/changelog_unreleased/api/pr-8983.md +++ /dev/null @@ -1,13 +0,0 @@ -#### [HIGHLIGHT]ESM standalone bundles ([#8983](https://github.com/prettier/prettier/pull/8983) by [@Monchi](https://github.com/Monchi), [@fisker](https://github.com/fisker)) - -Prettier now also comes as ES modules, which can be directly used in modern browsers: - -```js -import prettier from "https://unpkg.com/prettier/esm/standalone.mjs"; -import parserGraphql from "https://unpkg.com/prettier/esm/parser-graphql.mjs"; - -prettier.format("query { }", { - parser: "graphql", - plugins: [parserGraphql], -}); -``` diff --git a/changelog_unreleased/api/pr-9371.md b/changelog_unreleased/api/pr-9371.md deleted file mode 100644 index 22af5459e..000000000 --- a/changelog_unreleased/api/pr-9371.md +++ /dev/null @@ -1,19 +0,0 @@ -#### Stop inferring the parser to be `json` for `.jsonl` files (#9371 by @fisker) - - -```console -// Prettier stable -$ prettier --check . -Checking formatting... -[error] bad.jsonl: SyntaxError: Unexpected token (2:1) -[error] 1 | '{"type": "t/f", "head": "England", "relation": "invaded", "tail": "United States"}' -[error] > 2 | '{"type": "t/f", "head": "England", "relation": "attacked", "tail": "Baltimore"}' -[error] | ^ -[error] 3 | -All matched files use Prettier code style! - -// Prettier master -$ prettier --check . -Checking formatting... -All matched files use Prettier code style! -``` diff --git a/changelog_unreleased/cli/pr-9298.md b/changelog_unreleased/cli/pr-9298.md deleted file mode 100644 index d402fa7d5..000000000 --- a/changelog_unreleased/cli/pr-9298.md +++ /dev/null @@ -1,15 +0,0 @@ -#### Fix: error on directories and files with numeric names (#9298 by @fisker) - - -```console -$ cat 1/index.js -hello('world') - -// Prettier stable -$ prettier 1 -[error] The "path" argument must be of type string. Received type number (1) - -// Prettier master -$ prettier 1 -hello("world"); -``` diff --git a/changelog_unreleased/css/9966.md b/changelog_unreleased/css/9966.md new file mode 100644 index 000000000..7bf310eda --- /dev/null +++ b/changelog_unreleased/css/9966.md @@ -0,0 +1,14 @@ +#### Fix absolute path in custom CSS -custom-url() calls (#9966 by @vjeux) + +The CSS parser is parsing this as `["division", "absolute/path"]` instead of a single `"/absolute/path"` token unless you are in a `url()` call. Because we put space after division, it results in an incorrect path. The fix was to avoid printing a space if a division is the first token of a call, which hopefully should be safe. + + +```css +-custom-url(/absolute/path) + +/* Prettier stable */ +-custom-url(/ absolute/path) + +/* Prettier master */ +-custom-url(/absolute/path) +``` diff --git a/changelog_unreleased/css/pr-9209.md b/changelog_unreleased/css/pr-9209.md deleted file mode 100644 index 2a3f7f244..000000000 --- a/changelog_unreleased/css/pr-9209.md +++ /dev/null @@ -1,42 +0,0 @@ -#### Improve formatting for custom properties (#9209 by @fisker) - -Thanks to [`PostCSS 8.0`](https://github.com/postcss/postcss/releases/tag/8.0.0), we can handle these edge cases on custom properties. - - -```css -/* Input */ -:root { - --empty: ; - --JSON: [1, "2", {"three": {"a":1}}, [4]]; - --javascript: function(rule) { console.log(rule) }; -} - -@supports (--element(".minwidth", { "minWidth": 300 })) { - [--self] { - background: greenyellow; - } -} - -/* Prettier stable */ -SyntaxError: (postcss) CssSyntaxError Missed semicolon (3:20) - 1 | :root { - 2 | --empty: ; -> 3 | --JSON: [1, "2", {"three": {"a":1}}, [4]]; - | ^ - 4 | --javascript: function(rule) { console.log(rule) }; - 5 | } - 6 | - -/* Prettier master */ -:root { - --empty: ; - --JSON: [1, "2", {"three": {"a": 1}}, [4]]; - --javascript: function(rule) {console.log(rule)}; -} - -@supports (--element(".minwidth", {"minWidth": 300})) { - [--self] { - background: greenyellow; - } -} -``` diff --git a/changelog_unreleased/flow/9767.md b/changelog_unreleased/flow/9767.md new file mode 100644 index 000000000..bcc28c110 --- /dev/null +++ b/changelog_unreleased/flow/9767.md @@ -0,0 +1,15 @@ +#### Fix missing semi in `declare export * from …` (#9767 by @fisker) + + + + +```jsx +// Input +declare export * from "ES6_ExportAllFrom_Source2"; + +// Prettier stable +declare export * from "ES6_ExportAllFrom_Source2" + +// Prettier master +declare export * from "ES6_ExportAllFrom_Source2"; +``` diff --git a/changelog_unreleased/flow/pr-9071.md b/changelog_unreleased/flow/pr-9071.md deleted file mode 100644 index 7859461a5..000000000 --- a/changelog_unreleased/flow/pr-9071.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Switch the `babel` parser to `babel-flow` if the `@flow` pragma is found (#9071 by @fisker) - -In practice, this means that as long as your Flow files have the pragma, it's safe to use the `.js` extension for them. Prettier will correctly parse and print them without any additional configuration. Previously, the pragma was recognized by the parser, but there existed minor correctness issues with the printer. E.g. it's not safe to unquote number keys in Flow. - - -```jsx -// Input (with --parser babel) -// @flow -f({ "2": 2 }) - -// Prettier stable -// @flow -f({ 2: 2 }); - -// Prettier master -// @flow -f({ "2": 2 }); -``` diff --git a/changelog_unreleased/flow/pr-9432.md b/changelog_unreleased/flow/pr-9432.md deleted file mode 100644 index a677ea504..000000000 --- a/changelog_unreleased/flow/pr-9432.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Enums with unknown members (#9432 by @gkz) - -Previously, was not supported. Now, the following is formatted: - - -```jsx -// Input -enum E { - A, - B, - ... -} - -// Prettier stable: parse error - -// Prettier master -enum E { - A, - B, - ... -} -``` diff --git a/changelog_unreleased/flow/pr-9457.md b/changelog_unreleased/flow/pr-9457.md deleted file mode 100644 index 7899e4fa5..000000000 --- a/changelog_unreleased/flow/pr-9457.md +++ /dev/null @@ -1,21 +0,0 @@ -#### `this` parameter annotations (#9457 by @dsainati1, #9489 by @fisker) - - -```jsx -// Input -function f(this: string, a: number) { -} - -type T = (this: boolean, a: number) => boolean; - -// Prettier stable -function f(this: string, a: number) {} - -type T = (a: number) => boolean; - -// Prettier master -function f(this: string, a: number) { -} - -type T = (this: boolean, a: number) => boolean; -``` diff --git a/changelog_unreleased/flow/pr-9523.md b/changelog_unreleased/flow/pr-9523.md deleted file mode 100644 index da75c9926..000000000 --- a/changelog_unreleased/flow/pr-9523.md +++ /dev/null @@ -1,18 +0,0 @@ -#### Support `BigIntLiteralTypeAnnotation` and `BigIntTypeAnnotation` (#9523 by @fisker) - -Add support for `BigIntLiteralTypeAnnotation` and `BigIntTypeAnnotation` in Flow. - - -```jsx -// Input -const foo: bigint = 1n; -const bar: baz<1n> = 1n; - -// Prettier stable -Error: unknown type: "BigIntTypeAnnotation" - at ... - -// Prettier master -const foo: bigint = 1n; -const bar: baz<1n> = 1n; -``` diff --git a/changelog_unreleased/flow/pr-9543.md b/changelog_unreleased/flow/pr-9543.md deleted file mode 100644 index bc6582b49..000000000 --- a/changelog_unreleased/flow/pr-9543.md +++ /dev/null @@ -1,25 +0,0 @@ -#### Treat more simple types as non-breaking in generic type annotations (#9543 by @fisker) - - -```jsx -// Input -const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo = a -const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<"STRING"> = a; -const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<0> = a; - -// Prettier master -const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo< - symbol -> = a; -const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo< - "STRING" -> = a; -const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo< - 0 -> = a; - -// Prettier stable (typescript and flow parser) -const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo = a -const foo2: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<"STRING"> = a; -const foo3: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<0> = a; -``` diff --git a/changelog_unreleased/flow/pr-9553.md b/changelog_unreleased/flow/pr-9553.md deleted file mode 100644 index a041ea4fb..000000000 --- a/changelog_unreleased/flow/pr-9553.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Fix missing parentheses around `prettier-ignore`d type assertions (#9553 by @fisker) - - -```jsx -// Input -transform( - // prettier-ignore - (pointTransformer: (Point => Point)) -); - -// Prettier stable -transform( - // prettier-ignore - pointTransformer: (Point => Point) -); - -// Prettier master -transform( - // prettier-ignore - (pointTransformer: (Point => Point)) -); -``` diff --git a/changelog_unreleased/flow/pr-9563.md b/changelog_unreleased/flow/pr-9563.md deleted file mode 100644 index 8260bb391..000000000 --- a/changelog_unreleased/flow/pr-9563.md +++ /dev/null @@ -1,22 +0,0 @@ -#### Improve comment types detection (#9563 by @fisker) - - -```jsx -// Input -foo/*::*/(baz); -class Foo { - bar( data: Array) {} -} - -// Prettier master -foo/*:: */(baz); -class Foo { - bar(data: Array/*:: */) {} -} - -// Prettier stable -foo/*:: */(baz); -class Foo { - bar(data: Array) {} -} -``` diff --git a/changelog_unreleased/handlebars/9082.md b/changelog_unreleased/handlebars/9082.md new file mode 100644 index 000000000..5c9d6070f --- /dev/null +++ b/changelog_unreleased/handlebars/9082.md @@ -0,0 +1,19 @@ +#### Preserve tilde comments (#9082 by @kangax, @fisker) + + +```hbs +{{!-- Input --}} +{{~! Comment }} +{{! Comment ~}} +{{~! Comment ~}} + +{{!-- Prettier stable --}} +{{! Comment }} +{{! Comment }} +{{! Comment }} + +{{!-- Prettier master --}} +{{~! Comment }} +{{! Comment ~}} +{{~! Comment ~}} +``` diff --git a/changelog_unreleased/handlebars/pr-9403.md b/changelog_unreleased/handlebars/pr-9403.md deleted file mode 100644 index b8afd996b..000000000 --- a/changelog_unreleased/handlebars/pr-9403.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Fix unstable newlines after `