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
@@ -315,6 +323,62 @@ Supported config file variants are documented on [prettier.io](https://prettier.
315
323
316
324
To apply prettier to more kinds of files, just add more formats.
317
325
326
+
<aname="prettier-plugins"></a>
327
+
### Using plugins for prettier
328
+
329
+
Since spotless uses the actual npm prettier package behind the scenes, it is possible to use prettier with
330
+
[plugins](https://prettier.io/docs/en/plugins.html#official-plugins) or [community-plugins](https://www.npmjs.com/search?q=prettier-plugin) in order to support even more file types.
<!-- use the devDependencyProperties writing style when the property-names are not well-formed such as @prettier/plugin-php -->
361
+
<devDependencyProperties>
362
+
<property>
363
+
<name>prettier</name>
364
+
<value>2.0.5</value>
365
+
</property>
366
+
<property>
367
+
<name>@prettier/plugin-php</name>
368
+
<value>0.14.2</value>
369
+
</property>
370
+
</devDependencyProperties>
371
+
<config>
372
+
<tabWidth>3</tabWidth>
373
+
<parser>php</parser>
374
+
</config>
375
+
</prettier>
376
+
</format>
377
+
378
+
</formats>
379
+
</configuration>
380
+
```
381
+
318
382
### Prerequisite: prettier requires a working NodeJS version
319
383
320
384
Prettier, like tsfmt, is based on NodeJS, so to use it, a working NodeJS installation (especially npm) is required on the host running spotless.
@@ -326,9 +390,7 @@ Spotless will try to auto-discover an npm installation. If that is not working f
326
390
...
327
391
```
328
392
329
-
Spotless uses npm to install necessary packages locally. It runs prettier using [J2V8](https://github.com/eclipsesource/J2V8) internally after that.
330
-
Development for J2V8 for non android envs is stopped (for Windows since J2V8 4.6.0 and Unix 4.8.0), therefore Prettier is limited to <= v1.19.0 as newer versions
331
-
use ES6 feature and that needs a newer J2V8 version.
393
+
Spotless uses npm to install necessary packages and to run the prettier formatter after that.
0 commit comments