@@ -1,6 +1,11 @@
3−
4+ <img src="vscode-extension/purslint.jpg" alt="Purslint logo" width="180" />
7+ <video src="demo.mp4" width="480" controls playsinline></video>
5A PureScript linter inspired by [hlint](https://github.com/ndmitchell/hlint), providing suggestions for cleaner, more idiomatic PureScript code.
10A PureScript linter inspired by [hlint](https://github.com/ndmitchell/hlint), providing suggestions for cleaner, more idiomatic PureScript code.
@@ -25,33 +30,19 @@ purelint --help
26- [PureScript](https://www.purescript.org/) compiler (`purs`)
31- [PureScript](https://www.purescript.org/) compiler (`purs`)
27- [Spago](https://github.com/purescript/spago) package manager
32- [Spago](https://github.com/purescript/spago) package manager
28−- [Go](https://golang.org/) 1.19+
33+- [Node.js](https://nodejs.org/) 18+
29−- [psgo](https://github.com/puregocore/psgo) - PureScript to Go compiler
31### Building
35### Building
34# Install dependencies
38# Install dependencies
35−spago install
39+npm install
37−# Build CLI
41+# Build and bundle CLI + LSP
38−purs compile --codegen corefn 'lib/**/*.purs' 'bin/purslint-cli/**/*.purs' '.spago/**/*.purs'
42+npm run dist
39−psgo output/*/corefn.json
43+
40−cp output/Main/Main.go main_cli.go
41−go build -o purelint main_cli.go
44−purs compile --codegen corefn 'lib/**/*.purs' 'bin/purslint-lsp/**/*.purs' '.spago/**/*.purs'
45−psgo output/*/corefn.json
46−cp output/Main/Main.go main_lsp.go
47−go build -o purelint-lsp main_lsp.go
49−# Build and run tests
44+# Run tests
50−purs compile --codegen corefn 'lib/**/*.purs' 'test/**/*.purs' '.spago/**/*.purs'
51−psgo output/*/corefn.json
52−cp output/Test.Main/Test_Main.go test_main.go
53−go build -o test-runner test_main.go
54−./test-runner
45+npm test
@@ -118,11 +109,12 @@ Create a `purelint.json` file in your project root:
119## Architecture
110## Architecture
121−PureLint is written in PureScript and compiled to Go using `psgo` (purescript-native). This allows:
112+PureLint is written in PureScript and compiled to JavaScript via
113+`purs-backend-es`, then bundled for Node.js. This allows:
123- Full access to the PureScript CST parser (`purescript-language-cst-parser`)
115- Full access to the PureScript CST parser (`purescript-language-cst-parser`)
124−- Native binary performance
116+- Straightforward distribution via npm
125−- Easy distribution without runtime dependencies
117+- A single runtime across CLI and LSP
127### Project Structure
119### Project Structure
@@ -162,6 +154,8 @@ via the workflow dispatch.
163- `purescript-language-cst-parser` - PureScript CST parser
155- `purescript-language-cst-parser` - PureScript CST parser
164- `purescript-lsp` - LSP protocol implementation (Go FFI)
156- `purescript-lsp` - LSP protocol implementation (Go FFI)
157+- `purs-backend-es` - PureScript to JavaScript backend
158+- `esbuild` - Bundler for CLI and LSP
166## License
160## License