diff --git a/.eslintrc.js b/.eslintrc.js index 965feb75e..562538ab6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -97,6 +97,7 @@ module.exports = { }, ], "import/order": "error", + "import/no-anonymous-default-export": "error", "regexp/match-any": [ "error", diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 471f732ee..9423d6060 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,6 +5,8 @@ # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt # Prettier bump after release +# 2.4.0 +ef514b9b5c817cf5105bac31a59e88cbdbdf189b # 2.3.2 0747d9204113ee4bb4e3c2bab113dc3772a5e8d9 # 2.3.1 diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index c6dd4d3af..4d1086e84 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 2.3.2** +**Prettier 2.4.0** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index c1eb47a77..392f0594a 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.3.2 +- Prettier Version: 2.4.0 - Running Prettier via: - Runtime: - Operating System: diff --git a/.github/workflows/dev-package-test.yml b/.github/workflows/dev-package-test.yml index 625a8b5f7..dd3b770f2 100644 --- a/.github/workflows/dev-package-test.yml +++ b/.github/workflows/dev-package-test.yml @@ -44,7 +44,7 @@ jobs: - name: Install Client Package if: ${{ matrix.NPM_CLIENT == 'pnpm' }} - run: npm install --global pnpm@5 + run: npm install --global pnpm - name: Run Tests run: yarn test:dev-package --maxWorkers=2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eebeea69..34fccfd16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.4.0 + +[diff](https://github.com/prettier/prettier/compare/2.3.2...2.4.0) + +đź”— [Release Notes](https://prettier.io/blog/2021/09/09/2.4.0.html) + # 2.3.2 [diff](https://github.com/prettier/prettier/compare/2.3.1...2.3.2) diff --git a/changelog_unreleased/cli/10924.md b/changelog_unreleased/cli/10924.md deleted file mode 100644 index 22486a31d..000000000 --- a/changelog_unreleased/cli/10924.md +++ /dev/null @@ -1,3 +0,0 @@ -#### Infer parser for `.stylelintrc` (#10924 by @SevenOutman) - -A `.stylelintrc` file (without extension) is handled using `json` and `yaml` parsers. diff --git a/changelog_unreleased/flow/11398.md b/changelog_unreleased/flow/11398.md deleted file mode 100644 index 02b564d6f..000000000 --- a/changelog_unreleased/flow/11398.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Print leading semi before Flow variance sigils (#11398 by @noppa) - - -```jsx -// Input -class A { - +one = function() {}; - -two = val(); - +#privOne = val(); - static +#privTwo = val(); -} -// Prettier stable -class A { - +one = function() {} - -two = val() - +#privOne = val() - static +#privTwo = val() -} -// Prettier main -class A { - +one = function() {}; - -two = val(); - +#privOne = val() - static +#privTwo = val() -} -``` diff --git a/changelog_unreleased/html/11006.md b/changelog_unreleased/html/11006.md deleted file mode 100644 index ec31be784..000000000 --- a/changelog_unreleased/html/11006.md +++ /dev/null @@ -1,35 +0,0 @@ -#### Replace `jsxBracketSameLine` option with `bracketSameLine` option (#11006 by @kurtztech) - -Deprecate the `jsxBracketSameLine` option in favour of new `bracketSameLine` option that will work for HTML, Angular, Vue, and JSX. - - -```html - -
lorem ipsum dolor sit amet
- - -
- lorem ipsum dolor sit amet -
- - - -
- lorem ipsum dolor sit amet -
-``` diff --git a/changelog_unreleased/javascript/11246.md b/changelog_unreleased/javascript/11246.md deleted file mode 100644 index 7530e7b41..000000000 --- a/changelog_unreleased/javascript/11246.md +++ /dev/null @@ -1,29 +0,0 @@ -#### Support parenthesized tagged template literals for styled components (#11246 by @sosukesuzuki) - - -```js -// Input -const StyledComponent = - /** @type {import('styled-components').ThemedStyledFunction<'div',null,{overlap: boolean}>} */ - (styled.div)` - position: fixed; - color: red; - `; - -// Prettier main -const StyledComponent = - /** @type {import('styled-components').ThemedStyledFunction<'div',null,{overlap: boolean}>} */ - (styled.div)` - position: fixed; - color: red; - `; - -// Prettier stable -const StyledComponent = - /** @type {import('styled-components').ThemedStyledFunction<'div',null,{overlap: boolean}>} */ - (styled.div)` - position: fixed; - color: red; - `; - -``` diff --git a/changelog_unreleased/javascript/11299.md b/changelog_unreleased/javascript/11299.md deleted file mode 100644 index 93c8fea17..000000000 --- a/changelog_unreleased/javascript/11299.md +++ /dev/null @@ -1,26 +0,0 @@ -#### Count correctly regex literals in method chain arguments (#11299 by @sosukesuzuki) - - -```js -// Input -foo1(/𠮟𠮟𠮟/).foo2(bar).foo3(baz); - -foo1(/叱叱叱/).foo2(bar).foo3(baz); - -// Prettier stable -foo1(/𠮟𠮟𠮟/) - .foo2(bar) - .foo3(baz); - -foo1(/叱叱叱/).foo2(bar).foo3(baz); - -// Prettier main -foo1(/𠮟𠮟𠮟/) - .foo2(bar) - .foo3(baz); - -foo1(/叱叱叱/) - .foo2(bar) - .foo3(baz); - -``` diff --git a/changelog_unreleased/javascript/11335.md b/changelog_unreleased/javascript/11335.md deleted file mode 100644 index ee81f936e..000000000 --- a/changelog_unreleased/javascript/11335.md +++ /dev/null @@ -1,20 +0,0 @@ -#### Support hack-style pipeline proposal (#11335 by @sosukesuzuki) - -Support new [hack-style pipeline proposal](https://github.com/js-choi/proposal-hack-pipes). We chose `%` as the topic token, following the official explainer. - -Also, [smart-style pipeline proposal](https://github.com/js-choi/proposal-smart-pipelines) is removed. See https://prettier.io/docs/en/rationale.html#disclaimer-about-non-standard-syntax for the rationale behind this decision. - -```js -// Input -const foo = fn() |> fn1(%) |> fn2(%); - -// Prettier stable -SyntaxError: Unexpected token (1:25) -> 1 | const foo = fn() |> fn1(%) |> fn2(%); - | ^ - 2 | - -// Prettier main -const foo = fn() |> fn1(%) |> fn(%); - -``` diff --git a/changelog_unreleased/scss/11461.md b/changelog_unreleased/scss/11461.md deleted file mode 100644 index 720248387..000000000 --- a/changelog_unreleased/scss/11461.md +++ /dev/null @@ -1,16 +0,0 @@ -#### Consistently quote Sass modules strings (#11461 by @niksy) - - -```scss -// Input -@use "sass:math"; -@forward "list"; - -// Prettier stable -@use "sass:math"; -@forward "list"; - -// Prettier main -@use 'sass:math'; -@forward 'list'; -``` diff --git a/changelog_unreleased/typescript/11247.md b/changelog_unreleased/typescript/11247.md deleted file mode 100644 index be5c164d7..000000000 --- a/changelog_unreleased/typescript/11247.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Fix formatting intersection types that includes mapped types (#11247 by @sosukesuzuki) - - -```ts -// Input -type Example = { - [A in B]: T; -} & { - [A in B]: T; -}; - -// Prettier stable -type Example = { - [A in B]: T; -} & - { - [A in B]: T; - }; - -// Prettier main -type Example = { - [A in B]: T; -} & { - [A in B]: T; -}; - -``` diff --git a/changelog_unreleased/typescript/11426.md b/changelog_unreleased/typescript/11426.md deleted file mode 100644 index 5a0bd11e5..000000000 --- a/changelog_unreleased/typescript/11426.md +++ /dev/null @@ -1,45 +0,0 @@ -#### Support TypeScript 4.4 (#11426 by @sosukesuzuki) - -Support [TypeScript 4.4](https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/)! - -##### [`static` Blocks in Classes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#static-blocks) - -Class Static Blocks syntax is a Stage 4 ECMAScript proposal. See https://github.com/tc39/proposal-class-static-block for more details. - - -```tsx -// Input -class Foo { - static count = 0; - - // This is a static block: - static { - if (someCondition()) { - Foo.count++; - } - } -} - -// Prettier stable -SyntaxError: Declaration expected. (5:9) - 3 | - 4 | // This is a static block: -> 5 | static { - | ^ - 6 | if (someCondition()) { - 7 | Foo.count++; - 8 | } - -// Prettier main -class Foo { - static count = 0; - - // This is a static block: - static { - if (someCondition()) { - Foo.count++; - } - } -} - -``` diff --git a/docs/browser.md b/docs/browser.md index fa1718e0d..8c650329e 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -32,8 +32,8 @@ See below for examples. ### Global ```html - - + + - + +