fix typos (#6642)
parent
02ec2337b8
commit
f8a4a61a62
|
@ -244,7 +244,7 @@ skipNewline(text: string, index: number, options: object): number;
|
||||||
hasNewline(text: string, index: number, options: object): boolean;
|
hasNewline(text: string, index: number, options: object): boolean;
|
||||||
hasNewlineInRange(text: string, start: number, start: number): boolean;
|
hasNewlineInRange(text: string, start: number, start: number): boolean;
|
||||||
hasSpaces(text: string, index: number, options: object): number;
|
hasSpaces(text: string, index: number, options: object): number;
|
||||||
makeString(rawContent: string, enclosingQuote: string, unescapeUnnecessarEscapes: boolean): string;
|
makeString(rawContent: string, enclosingQuote: string, unescapeUnnecessaryEscapes: boolean): string;
|
||||||
getNextNonSpaceNonCommentCharacterIndex(text: string, node: object, options: object): number;
|
getNextNonSpaceNonCommentCharacterIndex(text: string, node: object, options: object): number;
|
||||||
isNextLineEmptyAfterIndex(text: string, index: number): boolean;
|
isNextLineEmptyAfterIndex(text: string, index: number): boolean;
|
||||||
isNextLineEmpty(text: string, node: object, options: object): boolean;
|
isNextLineEmpty(text: string, node: object, options: object): boolean;
|
||||||
|
|
|
@ -39,7 +39,7 @@ In older IDE versions, select Custom and do the following configuration:
|
||||||
|
|
||||||
### Using Prettier with ESLint
|
### Using Prettier with ESLint
|
||||||
|
|
||||||
If you are using ESLint with [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), use the `Fix ESLint Problems` action to reformat the currect file – find it using _Find Action_ (`Cmd/Ctrl-Shift-A`) or [add a keyboard shortcut](https://www.jetbrains.com/help/webstorm/configuring-keyboard-shortcuts.html) to it in _Preferences | Keymap_ and then use it.
|
If you are using ESLint with [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), use the `Fix ESLint Problems` action to reformat the current file – find it using _Find Action_ (`Cmd/Ctrl-Shift-A`) or [add a keyboard shortcut](https://www.jetbrains.com/help/webstorm/configuring-keyboard-shortcuts.html) to it in _Preferences | Keymap_ and then use it.
|
||||||
|
|
||||||
Make sure that the ESLint integration is enabled in _Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint_.
|
Make sure that the ESLint integration is enabled in _Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint_.
|
||||||
|
|
||||||
|
|
|
@ -822,7 +822,7 @@ function normalizeDetailedOption(name, option) {
|
||||||
typeof choice === "object" ? choice : { value: choice }
|
typeof choice === "object" ? choice : { value: choice }
|
||||||
);
|
);
|
||||||
if (newChoice.value === true) {
|
if (newChoice.value === true) {
|
||||||
newChoice.value = ""; // backward compability for original boolean option
|
newChoice.value = ""; // backward compatibility for original boolean option
|
||||||
}
|
}
|
||||||
return newChoice;
|
return newChoice;
|
||||||
})
|
})
|
||||||
|
|
|
@ -476,16 +476,16 @@ function genericPrint(path, options, print) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore spaces before/after string interpolation (i.e. `"#{my-fn("_")}"`)
|
// Ignore spaces before/after string interpolation (i.e. `"#{my-fn("_")}"`)
|
||||||
const isStartSCSSinterpolationInString =
|
const isStartSCSSInterpolationInString =
|
||||||
iNode.type === "value-string" && iNode.value.startsWith("#{");
|
iNode.type === "value-string" && iNode.value.startsWith("#{");
|
||||||
const isEndingSCSSinterpolationInString =
|
const isEndingSCSSInterpolationInString =
|
||||||
insideSCSSInterpolationInString &&
|
insideSCSSInterpolationInString &&
|
||||||
iNextNode.type === "value-string" &&
|
iNextNode.type === "value-string" &&
|
||||||
iNextNode.value.endsWith("}");
|
iNextNode.value.endsWith("}");
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isStartSCSSinterpolationInString ||
|
isStartSCSSInterpolationInString ||
|
||||||
isEndingSCSSinterpolationInString
|
isEndingSCSSInterpolationInString
|
||||||
) {
|
) {
|
||||||
insideSCSSInterpolationInString = !insideSCSSInterpolationInString;
|
insideSCSSInterpolationInString = !insideSCSSInterpolationInString;
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ function embed(path, print, textToDoc, options) {
|
||||||
return concat([node.rawName, "=", node.value]);
|
return concat([node.rawName, "=", node.value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// lwc: html`<my-element data-for={value}></my-elememt>`
|
// lwc: html`<my-element data-for={value}></my-element>`
|
||||||
if (options.parser === "lwc") {
|
if (options.parser === "lwc") {
|
||||||
const interpolationRegex = /^\{[\s\S]*\}$/;
|
const interpolationRegex = /^\{[\s\S]*\}$/;
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -321,7 +321,7 @@ function printGraphqlComments(lines) {
|
||||||
lines
|
lines
|
||||||
.map(textLine => textLine.trim())
|
.map(textLine => textLine.trim())
|
||||||
.forEach((textLine, i, array) => {
|
.forEach((textLine, i, array) => {
|
||||||
// Lines are either whitespace only, or a comment (with poential whitespace
|
// Lines are either whitespace only, or a comment (with potential whitespace
|
||||||
// around it). Drop whitespace-only lines.
|
// around it). Drop whitespace-only lines.
|
||||||
if (textLine === "") {
|
if (textLine === "") {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -368,7 +368,7 @@ function needsParens(path, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add parenthesis when working with bitwise operators
|
// Add parenthesis when working with bitwise operators
|
||||||
// It's not stricly needed but helps with code understanding
|
// It's not strictly needed but helps with code understanding
|
||||||
if (util.isBitwiseOperator(po)) {
|
if (util.isBitwiseOperator(po)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4179,7 +4179,7 @@ function printFunctionParams(path, print, options, expandArg, printTypeParams) {
|
||||||
const lastParam = getLast(fun[paramsField]);
|
const lastParam = getLast(fun[paramsField]);
|
||||||
|
|
||||||
// If the parent is a call with the first/last argument expansion and this is the
|
// If the parent is a call with the first/last argument expansion and this is the
|
||||||
// params of the first/last argument, we dont want the arguments to break and instead
|
// params of the first/last argument, we don't want the arguments to break and instead
|
||||||
// want the whole expression to be on a new line.
|
// want the whole expression to be on a new line.
|
||||||
//
|
//
|
||||||
// Good: Bad:
|
// Good: Bad:
|
||||||
|
@ -4844,7 +4844,7 @@ function printMemberChain(path, options, print) {
|
||||||
// The first group is the first node followed by
|
// The first group is the first node followed by
|
||||||
// - as many CallExpression as possible
|
// - as many CallExpression as possible
|
||||||
// < fn()()() >.something()
|
// < fn()()() >.something()
|
||||||
// - as many array acessors as possible
|
// - as many array accessors as possible
|
||||||
// < fn()[0][1][2] >.something()
|
// < fn()[0][1][2] >.something()
|
||||||
// - then, as many MemberExpression as possible but the last one
|
// - then, as many MemberExpression as possible but the last one
|
||||||
// < this.items >.something()
|
// < this.items >.something()
|
||||||
|
|
|
@ -24,7 +24,7 @@ Prettier is not only a useful tool but it's also a really cool piece of technolo
|
||||||
|
|
||||||
Thanks to [@stubailo](https://github.com/stubailo), [@jnwng](https://github.com/jnwng), [@tgriesser](https://github.com/tgriesser) and [@azz](https://github.com/azz), prettier now supports printing GraphQL queries!
|
Thanks to [@stubailo](https://github.com/stubailo), [@jnwng](https://github.com/jnwng), [@tgriesser](https://github.com/tgriesser) and [@azz](https://github.com/azz), prettier now supports printing GraphQL queries!
|
||||||
|
|
||||||
It works for `.graphql` files and within JavaScipt templates that start with `graphql`, `graphql.experimental` and `gql` in order to work with [Relay](https://facebook.github.io/relay/) and [Apollo](https://www.apollodata.com/).
|
It works for `.graphql` files and within JavaScript templates that start with `graphql`, `graphql.experimental` and `gql` in order to work with [Relay](https://facebook.github.io/relay/) and [Apollo](https://www.apollodata.com/).
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
```jsx
|
```jsx
|
||||||
|
|
Loading…
Reference in New Issue