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
Copy file name to clipboardExpand all lines: README.md
+84-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,77 @@
6
6
[![JSDocs][jsdocs-src]][jsdocs-href]
7
7
[![License][license-src]][license-href]
8
8
9
-
Plain text formatters integration for ESLint.
9
+
Format various languages with formatters in ESLint. Supports [Prettier](https://prettier.io/) and [dprint](https://dprint.dev/). Side-effects-free and fully configurable.
10
+
11
+
## Usages
12
+
13
+
### Install
14
+
15
+
```bash
16
+
npm i -D eslint-plugin-format
17
+
```
18
+
19
+
### Configure
20
+
21
+
This plugin does not do language detection or reading configure files, you need to specify the language for each file type you want to format along with other formatting options. We recommend using [ESLint's Flat Config format](https://eslint.org/docs/latest/use/configure/configuration-files-new).
-`parser` (required) - the language to format, [Supported languages](https://prettier.io/docs/en/options.html#parser)
69
+
- The rest options are passed as Prettier options
70
+
71
+
### `format/dprint`
72
+
73
+
Use dprint to format files.
74
+
75
+
#### Options
76
+
77
+
-`language` (required) - the language to format, or can be a filepath or URL to the WASM binary. [Supported languages](https://dprint.dev/plugins/)
78
+
-`languageOptions` - the options for the language
79
+
- The rest options are passed as dprint's general options
10
80
11
81
## Sponsors
12
82
@@ -16,6 +86,19 @@ Plain text formatters integration for ESLint.
16
86
</a>
17
87
</p>
18
88
89
+
## FAQ
90
+
91
+
### What's the difference between this and `eslint-plugin-prettier`?
92
+
93
+
While this plugin provides Prettier as one of the formatters, the main difference is that `eslint-plugin-prettier` is much more opinionated toward the Prettier CLI ecosystem. While this plugin only treats Prettier as the side-effects-free formatter and gives you full control in ESLint.
94
+
95
+
## Credits
96
+
97
+
Thanks to the existing works for references and inspiration.
0 commit comments