Skip to content

Commit

Permalink
Add .npmrc detection to the README TOC, and remove duplicate info f…
Browse files Browse the repository at this point in the history
…rom tsfmt.
  • Loading branch information
nedtwigg committed Nov 2, 2020
1 parent 0c56866 commit 4eb8ef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 44 deletions.
26 changes: 3 additions & 23 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
- [SQL](#sql) ([dbeaver](#dbeaver), [prettier](#prettier))
- [Typescript](#typescript) ([tsfmt](#tsfmt), [prettier](#prettier))
- Multiple languages
- [Prettier](#prettier) ([plugins](#prettier-plugins), [npm detection](#npm-detection))
- [Prettier](#prettier) ([plugins](#prettier-plugins), [npm detection](#npm-detection), [`.npmrc` detection](#npmrc-detection))
- javascript, jsx, angular, vue, flow, typescript, css, less, scss, html, json, graphql, markdown, ymaml
- [clang-format](#clang-format)
- c, c++, c#, objective-c, protobuf, javascript, java
Expand Down Expand Up @@ -515,27 +515,7 @@ spotless {
**Prerequisite: tsfmt requires a working NodeJS version**
tsfmt is based on NodeJS, so to use it, a working NodeJS installation (especially npm) is required on the host running spotless.
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.
```gradle
spotless {
typescript {
tsfmt().npmExecutable('/usr/bin/npm').config(...)
```
**Configuring npm using `.npmrc` file**
Spotless picks up npm configuration stored in a `.npmrc` file either in the project directory or in your user home.
Alternatively you can supply spotless with a location of the `.npmrc` file to use. (This can be combined with `npmExecutable`, of course.)
```gradle
spotless {
typescript {
tsfmt().npmrc("$projectDir/config/.npmrc").config(...)
```
For details, see the [npm detection](#npm-detection) and [`.npmrc` detection](#npmrc-detection) sections of prettier, which apply also to tsfmt.
<a name="applying-prettier-to-javascript--flow--typescript--css--scss--less--jsx--graphql--yaml--etc"></a>
Expand Down Expand Up @@ -604,7 +584,7 @@ spotless {
prettier().npmExecutable('/usr/bin/npm').config(...)
```
### Configuring npm using `.npmrc` file
### `.npmrc` detection
Spotless picks up npm configuration stored in a `.npmrc` file either in the project directory or in your user home.
Alternatively you can supply spotless with a location of the `.npmrc` file to use. (This can be combined with `npmExecutable`, of course.)
Expand Down
24 changes: 3 additions & 21 deletions plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ user@machine repo % mvn spotless:check
- [Sql](#sql) ([dbeaver](#dbeaver))
- [Typescript](#typescript) ([tsfmt](#tsfmt), [prettier](#prettier))
- Multiple languages
- [Prettier](#prettier) ([plugins](#prettier-plugins), [npm detection](#npm-detection))
- [Prettier](#prettier) ([plugins](#prettier-plugins), [npm detection](#npm-detection), [`.npmrc` detection](#npmrc-detection))
- [eclipse web tools platform](#eclipse-web-tools-platform)
- **Language independent**
- [Generic steps](#generic-steps)
Expand Down Expand Up @@ -481,25 +481,7 @@ The auto-discovery of config files (up the file tree) will not work when using t

**Prerequisite: tsfmt requires a working NodeJS version**

tsfmt is based on NodeJS, so to use it, a working NodeJS installation (especially npm) is required on the host running spotless.
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.

```xml
<tsfmt>
<npmExecutable>/usr/bin/npm</npmExecutable>
</tsfmt>
```

**Configuring npm using `.npmrc` file**

Spotless picks up npm configuration stored in a `.npmrc` file either in the project directory or in your user home.
Alternatively you can supply spotless with a location of the `.npmrc` file to use. (This can be combined with `npmExecutable`, of course.)

```xml
<tsfmt>
<npmrc>/usr/local/shared/.npmrc</npmrc>
</tsfmt>
```
For details, see the [npm detection](#npm-detection) and [`.npmrc` detection](#npmrc-detection) sections of prettier, which apply also to tsfmt.

<a name="applying-prettier-to-javascript--flow--typescript--css--scss--less--jsx--graphql--yaml--etc"></a>

Expand Down Expand Up @@ -625,7 +607,7 @@ Spotless will try to auto-discover an npm installation. If that is not working f
<npmExecutable>/usr/bin/npm</npmExecutable>
```

### Configuring npm using `.npmrc` file
### `.npmrc` detection

Spotless picks up npm configuration stored in a `.npmrc` file either in the project directory or in your user home.
Alternatively you can supply spotless with a location of the `.npmrc` file to use. (This can be combined with `npmExecutable`, of course.)
Expand Down

0 comments on commit 4eb8ef1

Please sign in to comment.