Prettier Plugin
Installation
Section titled “Installation”npm install -D prettier @puruslang/prettier-plugin-purusnpx prettier --plugin @puruslang/prettier-plugin-purus --write "**/*.{purus,cpurus,mpurus}"Config file
Section titled “Config file”Add to your .prettierrc:
{ "plugins": ["@puruslang/prettier-plugin-purus"], "tabWidth": 2}What it formats
Section titled “What it formats”- 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
Example
Section titled “Example”Before:
const x be 42fn greet name console.log[ name ]After:
const x be 42fn greet name console.log[name]