Document that Prettier never unquotes numeric properties in TS and Flow (#10126)
* Document that Prettier never unquotes numeric properties in TS and Flow * Add Angular * Mention Vue
This commit is contained in:
1 parent
cdab1d7392
commit
343d372845
2 files changed
+14
No files matched your search
@@ -89,6 +89,13 @@ Valid options:
|
||||
| ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||
| `"as-needed"` | <code>--quote-props <as-needed|consistent|preserve></code> | <code>quoteProps: "<as-needed|consistent|preserve>"</code> |
|
||||
|
||||
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.
|
||||
|
||||
@@ -90,6 +90,13 @@ Valid options:
|
||||
| ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||
| `"as-needed"` | <code>--quote-props <as-needed|consistent|preserve></code> | <code>quoteProps: "<as-needed|consistent|preserve>"</code> |
|
||||
|
||||
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.
|
||||
|
||||
Reference in new issue
Block a user