@@ -4,20 +4,9 @@ A PureScript linter inspired by [hlint](https://github.com/ndmitchell/hlint), pr
7−PureLint includes 10 lint rules:
7+PureLint currently ships with **81 lint rules**, covering common PureScript refactors and simplifications.
9−| Rule | Description | Example |
9+For a complete list, see `lib/purelint/src/Purelint/Rules/`.
10−|------|-------------|---------|
11−| `FmapId` | `map identity x` → `x` | Redundant identity mapping |
12−| `ConcatMap` | `join <<< map f` → `f =<< _` | Use bind instead of join+map |
13−| `MapFusion` | `map f <<< map g` → `map (f <<< g)` | Fuse consecutive maps |
14−| `UseTraverse` | `sequence <<< map f` → `traverse f` | Use traverse |
15−| `NotEqual` | `not (x == y)` → `x /= y` | Use not-equal operator |
16−| `UseGuard` | `if c then Just x else Nothing` → `guard` | Use guard from Control.MonadZero |
17−| `EtaReduce` | `\x -> f x` → `f` | Eta reduce lambdas |
18−| `EtaReduceDecl` | `f x = g x` → `f = g` | Eta reduce declarations |
19−| `RedundantBind` | `x >>= pure` → `x` | Remove redundant bind |
20−| `LetToWhere` | `let x = y in z` → `z where x = y` | Prefer where clauses |
22## Installation
11## Installation
@@ -84,6 +73,28 @@ A Zed extension is available in the `zed-extension/` directory. To install:
85The extension will automatically use the `purelint-lsp` binary.
74The extension will automatically use the `purelint-lsp` binary.
76+#### Neovim (nvim-lspconfig)
78+After building `purelint-lsp` (see build steps below), you can configure Neovim like this:
81+require("lspconfig").purelint = {
83+ cmd = { "/path/to/purelint-lsp" },
84+ filetypes = { "purescript" },
85+ root_dir = require("lspconfig.util").root_pattern(".git", "spago.yaml", "package.json"),
89+require("lspconfig").purelint.setup({})
92+If you prefer to run the bundled JS directly:
95+cmd = { "node", "/path/to/dist/purelint-lsp.js" }
87## Configuration
98## Configuration
89Create a `purelint.json` file in your project root:
100Create a `purelint.json` file in your project root: