Skip to content

Commit

Permalink
Merge branch 'main' into sass-with-print-width
Browse files Browse the repository at this point in the history
  • Loading branch information
lipis committed Nov 24, 2021
2 parents 23d4faa + 15f869d commit 3cee521
Show file tree
Hide file tree
Showing 180 changed files with 4,932 additions and 3,645 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -12,7 +12,7 @@ insert_final_newline = true
indent_size = 4
insert_final_newline = false

[website/blog/*.md]
[{,website/blog/,changelog_unreleased/**/}*.md]
trim_trailing_whitespace = false

[tests/{**/__snapshots__/*, tests/format/**/*}]
Expand Down
13 changes: 10 additions & 3 deletions .eslintrc.js
Expand Up @@ -4,9 +4,10 @@ const { isCI } = require("ci-info");
module.exports = {
root: true,
env: {
es2020: true,
es2021: true,
node: true,
},
reportUnusedDisableDirectives: true,
extends: ["eslint:recommended", "prettier"],
plugins: ["prettier-internal-rules", "import", "regexp", "unicorn"],
settings: {
Expand Down Expand Up @@ -89,7 +90,7 @@ module.exports = {
},
],

"import/extensions": ["error", "always", { ignorePackages: true }],
"import/extensions": ["error", "ignorePackages"],
"import/no-extraneous-dependencies": [
"error",
{
Expand Down Expand Up @@ -118,6 +119,8 @@ module.exports = {
"unicorn/new-for-builtins": "error",
"unicorn/no-array-for-each": "error",
"unicorn/no-array-push-push": "error",
"unicorn/no-new-array": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/no-useless-undefined": "error",
"unicorn/prefer-array-flat": [
"error",
Expand All @@ -126,12 +129,15 @@ module.exports = {
},
],
"unicorn/prefer-array-flat-map": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-number-properties": "error",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/prefer-regexp-test": "error",
"unicorn/prefer-spread": "error",
"unicorn/prefer-string-slice": "error",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/prefer-type-error": "error",
},
overrides: [
{
Expand Down Expand Up @@ -168,6 +174,7 @@ module.exports = {
alwaysAwait: true,
},
],
"jest/prefer-to-be": "error",
},
},
{
Expand Down Expand Up @@ -229,7 +236,7 @@ module.exports = {
functions: ["hasComment", "getComments"],
},
"src/language-js/pragma.js",
"src/language-js/parse/postprocess.js",
"src/language-js/parse/postprocess/*.js",
"src/language-js/parse/babel.js",
"src/language-js/parse/meriyah.js",
"src/language-js/parse/json.js",
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Expand Up @@ -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.1
2b5b22056e7e180ba52b04c849b6e8a1e26d87d1
# 2.4.0
ef514b9b5c817cf5105bac31a59e88cbdbdf189b
# 2.3.2
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/formatting.md
Expand Up @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
-->

**Prettier 2.4.0**
**Prettier 2.4.1**
[Playground link](https://prettier.io/playground/#.....)

```sh
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/integration.md
Expand Up @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:

**Environments:**

- Prettier Version: 2.4.0
- Prettier Version: 2.4.1
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-package-test.yml
Expand Up @@ -31,10 +31,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
node-version: ${{ matrix.node }}
cache: "yarn"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dev-test.yml
Expand Up @@ -18,13 +18,13 @@ jobs:
- "macos-latest"
- "windows-latest"
node:
- "16"
- "16.10.0"
- "14"
- "12"
include:
# only enable coverage on the fastest job
- os: "ubuntu-latest"
node: "16"
node: "16.10.0"
ENABLE_CODE_COVERAGE: true
FULL_TEST: true
CHECK_TEST_PARSERS: true
Expand All @@ -41,13 +41,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
# `codecov/codecov-action` require depth to be at least `2`, see #10219
with:
fetch-depth: 2

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
node-version: ${{ matrix.node }}
cache: "yarn"
Expand All @@ -64,7 +64,7 @@ jobs:
run: yarn test --maxWorkers=2

- name: Upload Coverage
uses: codecov/codecov-action@v2.0.3
uses: codecov/codecov-action@v2.1.0
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
with:
fail_ci_if_error: true
Expand All @@ -76,7 +76,7 @@ jobs:
PRETTIER_FALLBACK_RESOLVE: true

- name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE)
uses: codecov/codecov-action@v2.0.3
uses: codecov/codecov-action@v2.1.0
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
with:
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions .github/workflows/eslint-rules.yml
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
cache: "yarn"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
cache: "yarn"

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lock.yml
Expand Up @@ -8,13 +8,13 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v3
with:
# https://github.com/dessant/lock-threads
github-token: ${{ github.token }}
issue-lock-inactive-days: "90"
issue-exclude-created-before: ""
issue-exclude-labels: "keep-unlocked, status:awaiting response"
issue-lock-labels: "locked-due-to-inactivity"
issue-lock-comment: ""
issue-inactive-days: "90"
exclude-issue-created-before: ""
exclude-any-issue-labels: "keep-unlocked, status:awaiting response"
add-issue-labels: "locked-due-to-inactivity"
issue-comment: ""
issue-lock-reason: "resolved"
2 changes: 1 addition & 1 deletion .github/workflows/mark-issue-duplicate.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, 'Duplicate of ') }}
steps:
- uses: actions-cool/issues-helper@v2.4.2
- uses: actions-cool/issues-helper@v2.5.0
with:
actions: "mark-duplicate"
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/prod-test.yml
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
cache: "yarn"

Expand Down Expand Up @@ -59,10 +59,10 @@ jobs:
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
cache: "yarn"

Expand All @@ -88,13 +88,13 @@ jobs:
- "macos-latest"
- "windows-latest"
node:
- "16"
- "16.10.0"
- "14"
- "12"
- "10"
include:
- os: "ubuntu-latest"
node: "16"
node: "16.10.0"
FULL_TEST: true
exclude:
- os: "macos-latest"
Expand All @@ -112,10 +112,10 @@ jobs:
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
node-version: ${{ matrix.node }}
cache: "yarn"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-script-test.yml
Expand Up @@ -20,10 +20,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Setup Node.js
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v2.4.1
with:
version: "14"
cache: "yarn"
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
@@ -1,3 +1,25 @@
# 2.4.1

[diff](https://github.com/prettier/prettier/compare/2.4.0...2.4.1)

#### Fix wildcard syntax in `@forward` ([#11482](https://github.com/prettier/prettier/pull/11482)) ([#11487](https://github.com/prettier/prettier/pull/11487) by [@niksy](https://github.com/niksy))

<!-- prettier-ignore -->
```scss
// Input
@forward "library" as btn-*;

// Prettier 2.4.0
@forward "library" as btn- *;

// Prettier 2.4.1
@forward "library" as btn-*;
```

#### Add new CLI option `debug-print-ast` ([#11514](https://github.com/prettier/prettier/pull/11514) by [@sosukesuzuki](https://github.com/sosukesuzuki))

A new `--debug-print-ast` CLI flag for debugging.

# 2.4.0

[diff](https://github.com/prettier/prettier/compare/2.3.2...2.4.0)
Expand Down Expand Up @@ -289,6 +311,7 @@ const foo = call<{
#### Fix order of `override` modifiers ([#10961](https://github.com/prettier/prettier/pull/10961) by [@sosukesuzuki](https://github.com/sosukesuzuki))
<!-- prettier-ignore -->
```ts
// Input
class Foo extends Bar {
Expand All @@ -297,7 +320,7 @@ class Foo extends Bar {

// Prettier stable
class Foo extends Bar {
abstract override foo: string;
override abstract foo: string;
}

// Prettier main
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -82,7 +82,7 @@ foo(
);
```

Prettier can be run [in your editor](http://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
Prettier can be run [in your editor](https://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!

---

Expand Down
3 changes: 3 additions & 0 deletions changelog_unreleased/cli/11514.md
@@ -0,0 +1,3 @@
#### Add new CLI option `debug-print-ast` (#11514 by @sosukesuzuki)

A new `--debug-print-ast` CLI flag for debugging.
14 changes: 14 additions & 0 deletions changelog_unreleased/handlebars/11524.md
@@ -0,0 +1,14 @@
#### Uses the opposite quote type for quotes inside mustache statements in attributes (#11524 by @bmaehr)

<!-- prettier-ignore -->
```hbs
{{!-- Input --}}
<div title="{{t 'login.username.description'}}" />
{{!-- Prettier main --}}
<div title="{{t 'login.username.description'}}" />
{{!-- Prettier stable --}}
<div title="{{t "login.username.description"}}" />
```
1 change: 1 addition & 0 deletions changelog_unreleased/html/11827.md
@@ -0,0 +1 @@
#### Reverts #7865, keeping class names on the same line (#11827 by @jlongster)
15 changes: 15 additions & 0 deletions changelog_unreleased/javascript/11593.md
@@ -0,0 +1,15 @@
#### Fix parentheses around sequence expression as body of arrow chain (#11593 by @bakkot)

The required parentheses around sequence expressions as the body of arrow functions were dropped for chained arrows, causing incorrect code to be generated. Now they are included.

<!-- prettier-ignore -->
```jsx
// Input
const f = () => () => (0, 1);

// Prettier stable
const f = () => () => 0, 1;

// Prettier main
const f = () => () => (0, 1);
```
18 changes: 18 additions & 0 deletions changelog_unreleased/javascript/11750.md
@@ -0,0 +1,18 @@
#### Ignore errors for sloppy mode syntax (#11750 by @fisker, #11778 by @sosukesuzuki)

<!-- prettier-ignore -->
```jsx
// Input
function foo() { var bar = 1; delete bar; }

// Prettier stable
SyntaxError: Deleting local variable in strict mode. (1:31)
> 1 | function foo() { var bar = 1; delete bar; }
| ^

// Prettier main
function foo() {
var bar = 1;
delete bar;
}
```

0 comments on commit 3cee521

Please sign in to comment.