You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
@@ -49,8 +49,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
@@ -63,8 +63,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
Copy file name to clipboardExpand all lines: website/versioned_docs/version-stable/configuration.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,3 +174,12 @@ You can also switch to the `flow` parser instead of the default `babel` for .js
174
174
## Configuration Schema
175
175
176
176
If you’d like a JSON schema to validate your configuration, one is available here: http://json.schemastore.org/prettierrc.
177
+
178
+
## EditorConfig
179
+
180
+
If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc. Currently, the following EditorConfig properties are supported:
- CSS, [Less](http://lesscss.org/), and [SCSS](https://sass-lang.com)
-[Markdown](https://commonmark.org/), including [GFM](https://github.github.com/gfm/) and [MDX](https://mdxjs.com/)
Setting `max_line_length` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s print width, unless overridden.
32
+
31
33
(If you don’t want line wrapping when formatting Markdown, you can set the [Prose Wrap](#prose-wrap) option to disable it.)
32
34
33
35
## Tab Width
@@ -38,6 +40,8 @@ Specify the number of spaces per indentation-level.
Setting `indent_size` or `tab_width` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s tab width, unless overridden.
44
+
41
45
## Tabs
42
46
43
47
Indent lines with tabs instead of spaces.
@@ -46,6 +50,8 @@ Indent lines with tabs instead of spaces.
46
50
| ------- | ------------ | ----------------- |
47
51
|`false`|`--use-tabs`|`useTabs: <bool>`|
48
52
53
+
Setting `indent_style` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s tab usage, unless overridden.
54
+
49
55
(Tabs will be used for _indentation_ but Prettier uses spaces to _align_ things, such as in ternaries.)
50
56
51
57
## Semicolons
@@ -260,6 +266,7 @@ Valid options:
260
266
-`"typescript"` (via [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint)) _First available in v1.4.0_
261
267
-`"espree"` (via [espree](https://github.com/eslint/espree)) _First available in v2.2.0_
262
268
-`"meriyah"` (via [meriyah](https://github.com/meriyah/meriyah)) _First available in v2.2.0_
269
+
-`"acorn"` (via [acorn](https://github.com/acornjs/acorn)) _First available in v2.6.0_
263
270
-`"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _First available in v1.7.1_
264
271
-`"scss"` (same parsers as `"css"`, prefers postcss-scss) _First available in v1.7.1_
265
272
-`"less"` (same parsers as `"css"`, prefers postcss-less) _First available in v1.7.1_
@@ -383,8 +390,8 @@ Whether or not to indent the code inside `<script>` and `<style>` tags in Vue fi
383
390
384
391
Valid options:
385
392
386
-
-`"false"` - Do not indent script and style tags in Vue files.
387
-
-`"true"` - Indent script and style tags in Vue files.
393
+
-`false` - Do not indent script and style tags in Vue files.
394
+
-`true` - Indent script and style tags in Vue files.
Setting `end_of_line` in an [`.editorconfig` file](https://editorconfig.org/) will configure Prettier’s end of line usage, unless overridden.
0 commit comments