A Prettier plugin to help you format Javascript and Typescript projects in a Ramses style easily.
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
npm install -D @frontboi/prettier-plugin-ramses-style
You then need to configure your .prettierrc.json
:
{
"plugins": ["@frontboi/prettier-plugin-ramses-style"]
}
A Prettier plugin must first parse the source code of the target language into a traversable data structure (Usually an Abstract Syntax Tree) and then print out that data structure in a "pretty" style.
CommonJS
.
You can try this package on a file using this custom script:
npm run prettify -- test/fixtures/comments.js
AST explorer Babel AST explorer) Simple tutorial
You can create a PR on this project and I will review it. If you prefer, you can contact me on Linkedin or by email ([email protected]).
Tom Blanchet - 2024