@cospaia/prettier-plugin-clojure

0.0.2 • Public • Published

@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

Package Sidebar

Install

npm i @cospaia/prettier-plugin-clojure

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

292 kB

Total Files

4

Last publish

Collaborators

  • cospaia