diff --git a/docs/options.md b/docs/options.md index 5a2bae808..aad2334b8 100644 --- a/docs/options.md +++ b/docs/options.md @@ -89,6 +89,13 @@ Valid options: | ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `"as-needed"` | --quote-props | quoteProps: "" | +Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys is significant in these languages. See: [Angular][quote-props-angular], [TypeScript][quote-props-typescript], [Flow][quote-props-flow]. Also Prettier doesn’t unquote numeric properties for Vue (see the [issue][quote-props-vue] about that). + +[quote-props-angular]: https://codesandbox.io/s/hungry-morse-foj87?file=/src/app/app.component.html +[quote-props-typescript]: https://www.typescriptlang.org/play?#code/DYUwLgBAhhC8EG8IEYBcKA0EBM7sQF8AoUSAIzkQgHJlr1ktrt6dCiiATEAY2CgBOICKWhR0AaxABPAPYAzCGGkAHEAugBuLr35CR4CGTKSZG5Wo1ltRKDHjHtQA +[quote-props-flow]: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAA8wBeMAb1TDAAYAuMARlQF8g +[quote-props-vue]: https://github.com/prettier/prettier/issues/10127 + ## JSX Quotes Use single quotes instead of double quotes in JSX. diff --git a/website/versioned_docs/version-stable/options.md b/website/versioned_docs/version-stable/options.md index 7fa1fa36d..38ebdad44 100644 --- a/website/versioned_docs/version-stable/options.md +++ b/website/versioned_docs/version-stable/options.md @@ -90,6 +90,13 @@ Valid options: | ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `"as-needed"` | --quote-props | quoteProps: "" | +Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys is significant in these languages. See: [Angular][quote-props-angular], [TypeScript][quote-props-typescript], [Flow][quote-props-flow]. Also Prettier doesn’t unquote numeric properties for Vue (see the [issue][quote-props-vue] about that). + +[quote-props-angular]: https://codesandbox.io/s/hungry-morse-foj87?file=/src/app/app.component.html +[quote-props-typescript]: https://www.typescriptlang.org/play?#code/DYUwLgBAhhC8EG8IEYBcKA0EBM7sQF8AoUSAIzkQgHJlr1ktrt6dCiiATEAY2CgBOICKWhR0AaxABPAPYAzCGGkAHEAugBuLr35CR4CGTKSZG5Wo1ltRKDHjHtQA +[quote-props-flow]: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAA8wBeMAb1TDAAYAuMARlQF8g +[quote-props-vue]: https://github.com/prettier/prettier/issues/10127 + ## JSX Quotes Use single quotes instead of double quotes in JSX.