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
* Eclipse-WTP formatter (web tools platform, not java) handles some character encodings incorrectly on OS with non-unicode default file encoding [#545](https://github.com/diffplug/spotless/issues/545). Fixed for Eclipse-WTP formatter Eclipse version 4.13.0 (default version).
Copy file name to clipboardexpand all lines: plugin-maven/README.md
+50
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,56 @@ By default, all files matching `src/main/cpp/**/*.<ext>` and `src/test/cpp/**/*.
193
193
```
194
194
Use the Eclipse to define the *Code Style preferences* (see [Eclipse documentation](https://www.eclipse.org/documentation/)). Within the preferences *Edit...* dialog, you can export your configuration as XML file, which can be used as a configuration `<file>`. If no `<file>` is provided, the CDT default configuration is used.
195
195
196
+
<aname="typescript"></a>
197
+
198
+
## Applying to Typescript source
199
+
200
+
```xml
201
+
<configuration>
202
+
<typescript>
203
+
<tsfmt>
204
+
<!-- optionally define which files will be formatted. -->
205
+
<includes>
206
+
<include>src/**/*.ts</include> <!-- default value if nothing is specified -->
207
+
</includes>
208
+
<!-- must specify exactly one of the following "{foo}File" or "config" elements -->
Supported config file types are `tsconfigFile`, `tslintFile`, `vscodeFile` and `tsfmtFile`. They are corresponding to the respective
227
+
[tsfmt-parameters](https://github.com/vvakame/typescript-formatter/blob/7764258ad42ac65071399840d1b8701868510ca7/lib/index.ts#L27L34). See [tsfmt's default config settings](https://github.com/vvakame/typescript-formatter/blob/7764258ad42ac65071399840d1b8701868510ca7/lib/utils.ts#L11L32) for what is available.
228
+
229
+
*Please note:*
230
+
The auto-discovery of config files (up the file tree) will not work when using tsfmt within spotless,
231
+
hence you are required to provide resolvable file paths for config files.
232
+
233
+
### Prerequisite: tsfmt requires a working NodeJS version
234
+
235
+
tsfmt is based on NodeJS, so to use it, a working NodeJS installation (especially npm) is required on the host running spotless.
236
+
Spotless will try to auto-discover an npm installation. If that is not working for you, it is possible to directly configure the npm binary to use.
237
+
238
+
```xml
239
+
<configuration><typescript><tsfmt>
240
+
...
241
+
<npmExecutable>/usr/bin/npm</npmExecutable>
242
+
```
243
+
244
+
Spotless uses npm to install necessary packages locally. It runs tsfmt using [J2V8](https://github.com/eclipsesource/J2V8) internally after that.
0 commit comments