Skip to content

Prettier Plugin

Terminal window
npm install -D prettier @puruslang/prettier-plugin-purus
Terminal window
npx prettier --plugin @puruslang/prettier-plugin-purus --write "**/*.{purus,cpurus,mpurus}"

Add to your .prettierrc:

{
"plugins": ["@puruslang/prettier-plugin-purus"],
"tabWidth": 2
}
  • Indentation: normalizes to consistent indent (spaces or tabs)
  • Spacing: normalizes whitespace between tokens
  • Brackets: no spaces inside [] for function calls
  • Separators: ensures space after , and ;
  • Trailing whitespace: removes trailing spaces
  • Trailing newline: ensures file ends with newline

Before:

const x be 42
fn greet name
console.log[ name ]

After:

const x be 42
fn greet name
console.log[name]