diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..cda3b3db3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +end_of_line = lf +insert_final_newline = true + +[cspell.json] +indent_size = 4 diff --git a/.eslintrc.yml b/.eslintrc.yml index 258210f06..5bee3c20c 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -42,6 +42,10 @@ rules: object: false - enforceForRenamedProperties: false prefer-spread: error + quotes: + - error + - double + - avoidEscape: true react/display-name: off react/no-deprecated: off react/prop-types: off diff --git a/changelog_unreleased/handlebars/pr-7051.md b/changelog_unreleased/handlebars/pr-7051.md index 505bf926e..5bfee4f32 100644 --- a/changelog_unreleased/handlebars/pr-7051.md +++ b/changelog_unreleased/handlebars/pr-7051.md @@ -1,4 +1,4 @@ -#### handlebars: Fix superfluous line breaks in ConcatStatement ([7051](https://github.com/prettier/prettier/pull/7051) by [@dcyriller](https://github.com/dcyriller)) +#### Fix superfluous line breaks in ConcatStatement ([7051](https://github.com/prettier/prettier/pull/7051) by [@dcyriller](https://github.com/dcyriller)) ```hbs diff --git a/changelog_unreleased/html/pr-5959 b/changelog_unreleased/html/pr-5959.md similarity index 100% rename from changelog_unreleased/html/pr-5959 rename to changelog_unreleased/html/pr-5959.md diff --git a/changelog_unreleased/html/pr-7293.md b/changelog_unreleased/html/pr-7293.md new file mode 100644 index 000000000..4cf00b2db --- /dev/null +++ b/changelog_unreleased/html/pr-7293.md @@ -0,0 +1,24 @@ +#### Do not throw on broken html ([#7293](https://github.com/prettier/prettier/pull/7293) by [@fisker](https://github.com/fisker)) + + +```html + +
+< + + +TypeError: Cannot read property 'start' of null + at hasTrailingLineBreak (https://prettier.io/lib/standalone.js:19694:169) + at forceBreakContent (https://prettier.io/lib/standalone.js:19668:154) + at Object.genericPrint$2 [as print] (https://prettier.io/lib/standalone.js:21068:126) + at callPluginPrintFunction (https://prettier.io/lib/standalone.js:15302:20) + at https://prettier.io/lib/standalone.js:15253:18 + at Object.printComments (https://prettier.io/lib/standalone.js:14974:19) + at printGenerically (https://prettier.io/lib/standalone.js:15252:24) + at printChild (https://prettier.io/lib/standalone.js:21227:14) + at https://prettier.io/lib/standalone.js:21211:104 + at FastPath.map (https://prettier.io/lib/standalone.js:15155:23) + + +
<
+``` diff --git a/changelog_unreleased/javascript/pr-7070.md b/changelog_unreleased/javascript/pr-7070.md index e105b65f2..96d3aa80c 100644 --- a/changelog_unreleased/javascript/pr-7070.md +++ b/changelog_unreleased/javascript/pr-7070.md @@ -1,4 +1,4 @@ -# Format `throw` like `return` ([#7070](https://github.com/prettier/prettier/pull/7070) by [@sosukesuzuki](https://github.com/sosukesuzuki)) +#### Format `throw` like `return` ([#7070](https://github.com/prettier/prettier/pull/7070) by [@sosukesuzuki](https://github.com/sosukesuzuki)) ```js @@ -21,4 +21,4 @@ function foo() { this.lookahead().type === tt.parenLeft.right ); } -``` +``` diff --git a/changelog_unreleased/javascript/pr-7140.md b/changelog_unreleased/javascript/pr-7140.md index 041b52b5a..ab1b98b5f 100644 --- a/changelog_unreleased/javascript/pr-7140.md +++ b/changelog_unreleased/javascript/pr-7140.md @@ -1,5 +1,6 @@ -#### Fix moving semi for `return` to end of line-comment([#7140](https://github.com/prettier/prettier/pull/7140) by [@sosukesuzuki](https://github.com/sosukesuzuki)) +#### Fix moving semicolon to trailing comment in `return` ([#7140](https://github.com/prettier/prettier/pull/7140) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + ```js // Input return // comment diff --git a/changelog_unreleased/scss/pr-7211.md b/changelog_unreleased/scss/pr-7211.md index 3c00f3ceb..dc283cbf5 100644 --- a/changelog_unreleased/scss/pr-7211.md +++ b/changelog_unreleased/scss/pr-7211.md @@ -19,4 +19,3 @@ a { background-image: url($test-path + "static/test.jpg"); } ``` - diff --git a/changelog_unreleased/typescript/pr-7075.md b/changelog_unreleased/typescript/pr-7075.md index 60c3da14e..9d8351dc8 100644 --- a/changelog_unreleased/typescript/pr-7075.md +++ b/changelog_unreleased/typescript/pr-7075.md @@ -1,8 +1,8 @@ -#### Don't print trailing commas after rest elements in tuples ([#7075](https://github.com/prettier/prettier/pull/7075) by [@thorn](https://github.com/thorn0)) +#### Don't print trailing commas after rest elements in tuples ([#7075](https://github.com/prettier/prettier/pull/7075) by [@thorn0](https://github.com/thorn0)) -* A rest element is always the last element of a tuple type. Nothing can be added after it. -* While TS is okay with this comma, [Babel doesn't parse it](https://github.com/babel/babel/issues/10769) -* In function parameters and array destructuring, such a comma is a syntax error. Keeping it in tuples is inconsistent. +- A rest element is always the last element of a tuple type. Nothing can be added after it. +- While TS is okay with this comma, [Babel doesn't parse it](https://github.com/babel/babel/issues/10769) +- In function parameters and array destructuring, such a comma is a syntax error. Keeping it in tuples is inconsistent. ```jsx diff --git a/changelog_unreleased/vue/pr-7180.md b/changelog_unreleased/vue/pr-7180.md index f93b06a88..cbd3958c4 100644 --- a/changelog_unreleased/vue/pr-7180.md +++ b/changelog_unreleased/vue/pr-7180.md @@ -1,5 +1,6 @@ -#### format vue SFC containing JSX script([#7180](https://github.com/prettier/prettier/pull/7180) by [@sosukesuzuki](https://github.com/sosukesuzuki)) +#### format vue SFC containing JSX script ([#7180](https://github.com/prettier/prettier/pull/7180) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + ```html