Skip to content

Commit ac67a74

Browse files
committed
docs: document rs fmt supported languages
1 parent 8c2523f commit ac67a74

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

scripts/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ huskyrc
1212
indentable
1313
jsonline
1414
llms
15+
MJML
1516
napi
1617
noformat
1718
noprettier

website/docs/en/guide/formatting.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ In addition to Prettier options and `overrides`, Rstack CLI provides two options
5454

5555
:::
5656

57+
## Supported languages
58+
59+
`rs fmt` supports the same built-in languages as [Prettier](https://prettier.io/docs/) and normally infers the language from the file name:
60+
61+
- [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), [JSX](https://react.github.io/jsx/), [Flow](https://flow.org/), and [TypeScript](https://www.typescriptlang.org/)
62+
- [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS), [Less](https://lesscss.org/), and [SCSS](https://sass-lang.com/)
63+
- [HTML](https://en.wikipedia.org/wiki/HTML), [Angular](https://angular.dev/), [Vue](https://vuejs.org/), [Ember/Handlebars](https://emberjs.com/), [Lightning Web Components (LWC)](https://developer.salesforce.com/developer-centers/lightning-web-components), and [MJML](https://mjml.io/)
64+
- [JSON](https://json.org/) and [YAML](https://yaml.org/)
65+
- [GraphQL](https://graphql.org/)
66+
- [Markdown](https://commonmark.org/), including [GFM](https://github.github.com/gfm/) and [MDX v1](https://mdxjs.com/)
67+
68+
You can add support for other languages with [Prettier plugins](#prettier-plugins).
69+
5770
## Formatting scope
5871

5972
`rs fmt` determines the formatting scope from the paths passed on the command line. You can combine the following inputs:

website/docs/zh/guide/formatting.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ define.fmt({
5454

5555
:::
5656

57+
## 支持的语言 \{#supported-languages}
58+
59+
`rs fmt` 支持与 [Prettier](https://prettier.io/docs/) 相同的内置语言,通常会根据文件名自动推断语言:
60+
61+
- [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)[JSX](https://react.github.io/jsx/)[Flow](https://flow.org/)[TypeScript](https://www.typescriptlang.org/)
62+
- [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS)[Less](https://lesscss.org/)[SCSS](https://sass-lang.com/)
63+
- [HTML](https://en.wikipedia.org/wiki/HTML)[Angular](https://angular.dev/)[Vue](https://vuejs.org/)[Ember/Handlebars](https://emberjs.com/)[Lightning Web Components(LWC)](https://developer.salesforce.com/developer-centers/lightning-web-components)[MJML](https://mjml.io/)
64+
- [JSON](https://json.org/)[YAML](https://yaml.org/)
65+
- [GraphQL](https://graphql.org/)
66+
- [Markdown](https://commonmark.org/),包括 [GFM](https://github.github.com/gfm/)[MDX v1](https://mdxjs.com/)
67+
68+
你可以通过 [Prettier 插件](#prettier-plugins)支持其他语言。
69+
5770
## 格式化范围 \{#formatting-scope}
5871

5972
`rs fmt` 根据命令行中传入的路径确定格式化范围。以下输入可以组合使用:

0 commit comments

Comments
 (0)