Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pez/prettier-plugin-clojure
An (almost) indentation-only, non-configurable, Prettier Plugin for Clojure and ClojureScript (and any sufficiently similar implementations).
https://github.com/pez/prettier-plugin-clojure
clojure clojurescript formatter prettier prettier-plugin
Last synced: about 2 months ago
JSON representation
An (almost) indentation-only, non-configurable, Prettier Plugin for Clojure and ClojureScript (and any sufficiently similar implementations).
- Host: GitHub
- URL: https://github.com/pez/prettier-plugin-clojure
- Owner: PEZ
- License: mit
- Created: 2022-11-08T13:13:44.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-08T14:10:23.000Z (about 2 years ago)
- Last Synced: 2024-11-11T10:55:44.147Z (2 months ago)
- Topics: clojure, clojurescript, formatter, prettier, prettier-plugin
- Language: Clojure
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @cospaia/prettier-plugin-clojure
An (almost) indentation-only, non-configurable, [Prettier](https://prettier.io/) Plugin for [Clojure](https://clojure.org) and [ClojureScript](https://clojurescript.org) (and any sufficiently similar implementations).
The plugin really is basic. It will format the code using [cljfmt](https://github.com/weavejester/cljfmt) defaults, without letting you configure anything. This means that mostly indentation will be applied, but there is also some folding of the bracket trail and trimming of whitespace inside the brackets, going on.
Is that really useful? I need it for a project, so, yes, at least to someone. 😄
## Using it
In the project you want to use it, you first:
0. `npm i prettier @cospaia/prettier-plugin-clojure`
Then you can do things like:
``` sh
$ npx prettier
```e.g:
```
$ npx prettier ./test-data/some_code.clj
$ npx prettier ./test-data/some-fenced-code.md
```## Testing it
In this project:
0. `npm i`
0. `npm run builddist`
0. `npx prettier --plugin . ./test-data/some_code.clj`
0. `npx prettier --plugin . ./test-data/some-fenced-code.md`See also [the test project](./prettier-clojure-test-project/).
## Author
Peter Strömberg, aka [PEZ](https://github.com/PEZ)
## Built with
* [ClojureScript](https://clojurescript.org)
* [shadow-cljs](https://github.com/thheller/shadow-cljs)
* [cljfmt](https://github.com/weavejester/cljfmt)## LICENSE
MIT