Registry / devops / pursfmt

pursfmt

JSON →
library0.17.0jsnpmunverified

Configurable syntax formatter for PureScript. Current stable version is 0.17.0. Uses a pre-baked operator precedence table for correct formatting without full codebase parsing. Key differentiator: editor integrations (Spacemacs, Vim, VS Code) and CI check commands. Compared to purty, it offers more configuration options and supports Nix.

npm install pursfmt
INSTALL
IMPORT
SIG · PURSFMT
P
pursfmt
devopsjavascriptv0.17.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
✓ import pursfmt from 'pursfmt'
✗ const pursfmt = require('pursfmt')
pursfmt is primarily a CLI tool; programmatic API may not be intended. Use the CLI via npx or local install.

Install pursfmt as a dev dependency, format PureScript files in-place, generate a config file, and verify files are formatted in CI.

npm install --save-dev pursfmt npx pursfmt format-in-place "src/**/*.purs" npx pursfmt generate-config --indent 2 --width 80 --arrow-last npx pursfmt check "src/**/*.purs"
Debug
Known issues
gotchaDo not install globally; different projects may need different versions.
fix
Install as a devDependency per project: npm install --save-dev pursfmt
affects: >=0.0.0
gotchaOperator precedence table may not cover all operators; custom table generation needed for contrib or custom operators.
fix
Generate a custom operator table: spago sources | xargs pursfmt generate-operators > .pursfmtoperators
affects: >=0.0.0
gotchaConfig file (.pursfmt.yaml) overrides CLI arguments; mixing can lead to unexpected behavior.
fix
Use either config file or CLI arguments consistently.
affects: >=0.0.0
Errors
Common errors & fixes
pursfmt: command not found
pursfmt not installed or not in PATH (global install missing).
fix
Ensure installed locally: npx pursfmt ...
Error: Cannot find module 'pursfmt'
Node.js cannot load the module when using programmatic API incorrectly.
fix
pursfmt is CLI-only; use npx or run via scripts.
Upgrade
Version history
0.17.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pursfmt — npm install pursfmt · libregistry