git.iko.soy/rowtype-yoga/purslint
on main help sign in
Document rules count and Neovim setup.
7f473eaMark
README.md+25−14
@@ -4,20 +4,9 @@ A PureScript linter inspired by [hlint](https://github.com/ndmitchell/hlint), pr
4
4
5## Features
5## Features
6
6
7−PureLint includes 10 lint rules:
7+PureLint currently ships with **81 lint rules**, covering common PureScript refactors and simplifications.
8−
8+
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 |
21
10
22## Installation
11## Installation
23
12
@@ -84,6 +73,28 @@ A Zed extension is available in the `zed-extension/` directory. To install:
84
73
85The extension will automatically use the `purelint-lsp` binary.
74The extension will automatically use the `purelint-lsp` binary.
86
75
76+#### Neovim (nvim-lspconfig)
77+
78+After building `purelint-lsp` (see build steps below), you can configure Neovim like this:
79+
80+```lua
81+require("lspconfig").purelint = {
82+ default_config = {
83+ cmd = { "/path/to/purelint-lsp" },
84+ filetypes = { "purescript" },
85+ root_dir = require("lspconfig.util").root_pattern(".git", "spago.yaml", "package.json"),
86+ },
87+}
88+
89+require("lspconfig").purelint.setup({})
90+```
91+
92+If you prefer to run the bundled JS directly:
93+
94+```lua
95+cmd = { "node", "/path/to/dist/purelint-lsp.js" }
96+```
97+
87## Configuration
98## Configuration
88
99
89Create a `purelint.json` file in your project root:
100Create a `purelint.json` file in your project root: