forked from prettier/prettier
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into comment-attach-refactor-2
# Conflicts: # src/main/comments.js
- Loading branch information
Showing
65 changed files
with
2,293 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#### Improve comment format (#9672 by @fisker) | ||
|
||
When multiple comments on same line, the result became unstable. | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
a; | ||
/*1*//*2*/ | ||
/*3*/ | ||
b; | ||
|
||
// Prettier stable | ||
a; /*2*/ | ||
/*1*/ /*3*/ | ||
b; | ||
|
||
// Prettier stable (second format) | ||
a; /*2*/ /*3*/ | ||
/*1*/ b; | ||
|
||
// Prettier master | ||
a; | ||
/*1*/ /*2*/ | ||
/*3*/ | ||
b; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#### Fix node ends at `rangeStart` was formatted (#9704 by @fisker) | ||
|
||
Previously a node ends at `rangeStart` in considered in range, now it's excluded. | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Prettier stable | ||
foo = 1.0000;bar = 1.0000;baz=1.0000; | ||
^^^^^^^^^^^^^ Range | ||
|
||
// Prettier stable | ||
foo = 1.0; | ||
bar = 1.0;baz=1.0000; | ||
|
||
// Prettier master | ||
foo = 1.0000;bar = 1.0;baz=1.0000; | ||
``` | ||
|
||
_This effect other languages support range format too._ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#### Fix inconsistent language comment detection (#9743 by @fisker) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
foo /* HTML */ = `<DIV> | ||
</DIV>`; | ||
|
||
// Prettier stable (--parser=babel) | ||
foo /* HTML */ = `<div></div>`; | ||
|
||
// Prettier stable (--parser=meriyah) | ||
foo /* HTML */ = `<DIV> | ||
</DIV>`; | ||
|
||
// Prettier master (All JavaScript parsers) | ||
foo /* HTML */ = `<DIV> | ||
</DIV>`; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#### Fix empty front matter formatting (#9791 by @fisker) | ||
|
||
<!-- prettier-ignore --> | ||
```markdown | ||
<!-- Input --> | ||
--- | ||
--- | ||
|
||
# Title | ||
|
||
a|b|c| | ||
|:--|:-:|--:| | ||
|d|e|f| | ||
|
||
--- | ||
|
||
text | ||
|
||
<!-- Prettier stable --> | ||
--- | ||
--- | ||
# Title | ||
|
||
a|b|c| | ||
|:--|:-:|--:| | ||
|d|e|f| | ||
--- | ||
|
||
text | ||
|
||
<!-- Prettier master --> | ||
--- | ||
--- | ||
|
||
# Title | ||
|
||
| a | b | c | | ||
| :-- | :-: | --: | | ||
| d | e | f | | ||
|
||
--- | ||
|
||
text | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#### Fix broken comment inside parens (#9710 by @fisker) | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
// Input | ||
.simplification { | ||
foo: ( | ||
calc() // not a comment anymore | ||
); | ||
} | ||
|
||
// Prettier stable | ||
.simplification { | ||
foo: (calc() // not a comment anymore); | ||
} | ||
|
||
// Prettier master | ||
.simplification { | ||
foo: ( | ||
calc() // not a comment anymore | ||
); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ See [Usage](#usage) below for examples. | |
### Global | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected].0/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].0/parser-graphql.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/parser-graphql.js"></script> | ||
<script> | ||
prettier.format("query { }", { | ||
parser: "graphql", | ||
|
@@ -51,8 +51,8 @@ prettier.format("query { }", { | |
|
||
```js | ||
define([ | ||
"https://unpkg.com/[email protected].0/standalone.js", | ||
"https://unpkg.com/[email protected].0/parser-graphql.js", | ||
"https://unpkg.com/[email protected].1/standalone.js", | ||
"https://unpkg.com/[email protected].1/parser-graphql.js", | ||
], (prettier, ...plugins) => { | ||
prettier.format("query { }", { parser: "graphql", plugins }); | ||
}); | ||
|
@@ -71,7 +71,7 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b | |
### Worker | ||
|
||
```js | ||
importScripts("https://unpkg.com/[email protected].0/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].0/parser-graphql.js"); | ||
importScripts("https://unpkg.com/[email protected].1/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].1/parser-graphql.js"); | ||
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.