@naturalcycles/ktlint
Version:
ktlint, conveniently published to npm registry
48 lines (31 loc) • 1.42 kB
Markdown
## @naturalcycles/ktlint
> [ktlint](https://github.com/pinterest/ktlint) conveniently published to npm registry
[](https://www.npmjs.com/package/@naturalcycles/ktlint)
[](https://github.com/prettier/prettier)
[](https://ktlint.github.io/)
Current ktlint version: `1.5.0`
# Quick start
Just run it without installation:
```shell
npx @naturalcycles/ktlint --version
```
Or, install it like this:
```shell
yarn add -D @naturalcycles/ktlint
```
Run ktlint (locally installed into `./node_modules`):
```shell
yarn ktlint --version
```
No Step 3!
## API
You can run `ktlint` programmatically via Node.js by calling `ktlintAll()` function exposed by this
module. It returns a Promise (rejects on non-zero code from `ktlint`, resolves on success).
## Development
To update the ktlint version that is shipped here:
- Check the ktlint [release notes](https://github.com/pinterest/ktlint/releases)
- Change it in `scripts/install.ts` to the new version (and in this readme.md too)
- Delete `resources/ktlint`
- Run `yarn tsn install`, which will download the new version
- Test it with `yarn ktlint --version`, it should print the new version
- Test it with `yarn ktlint -F`