A syntax tidy-upper (formatter) for PureScript.
npm install -g purs-tidyYou can use purs-tidy to format files in place or via STDIN / STDOUT (which is useful for editor integration):
# Formatting a collection of files in place:
$ purs-tidy format-in-place "src/**/*.purs"
# Using STDIN to format a file:
$ purs-tidy format < MyFile.pursYou can see all configuration that purs-tidy accepts using the --help flag for the command you are using:
$ purs-tidy format-in-place --helpSome common options include:
--indentto set the number of spaces used in indentation, which defaults to 2 spaces--arrow-firstor--arrow-lastto control whether type signatures put arrows first on the line or last on the line (purty-style), which defaults to arrow-last.
spago -x ./bin/spago.dhall build
./bin/index.js --helpTo accept snapshot tests:
spago -x ./test/spago.dhall test -a "--accept"spago -x ./script/spago.dhall run -m GenerateDefaultOperatorsModuleFirst, install the Run on Save extension so that you can execute a command when your file is saved. Then, add this to your settings.json:
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".purs",
"cmd": "$TIDY_DIR/bin/index.js format-in-place ${relativeFile}"
}
]
}...where $TIDY_DIR is replaced with the location of a checkout of purescript-tidy.