Skip to content

An (almost) indentation-only, non-configurable, Prettier Plugin for Clojure and ClojureScript (and any sufficiently similar implementations).

License

Notifications You must be signed in to change notification settings

PEZ/prettier-plugin-clojure

Repository files navigation

@cospaia/prettier-plugin-clojure

An (almost) indentation-only, non-configurable, Prettier Plugin for Clojure and ClojureScript (and any sufficiently similar implementations).

The plugin really is basic. It will format the code using 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:

  1. npm i prettier @cospaia/prettier-plugin-clojure

Then you can do things like:

$ npx prettier <clojure-file | markdown-file-w-fenced-clojure-block>

e.g:

$ npx prettier ./test-data/some_code.clj
$ npx prettier ./test-data/some-fenced-code.md

Testing it

In this project:

  1. npm i
  2. npm run builddist
  3. npx prettier --plugin . ./test-data/some_code.clj
  4. npx prettier --plugin . ./test-data/some-fenced-code.md

See also the test project.

Author

Peter Strömberg, aka PEZ

Built with

LICENSE

MIT

About

An (almost) indentation-only, non-configurable, Prettier Plugin for Clojure and ClojureScript (and any sufficiently similar implementations).

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project