@amritk/lint 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -129,7 +129,7 @@ One thing `restrictTo` does not cover: a regular expression a ruleset writes —
129
129
 
130
130
  ### Auto-fix
131
131
 
132
- `fixDocument` runs the linter and applies a `FixerRegistry` — fixers keyed by rule `code` that map a finding to a formatting-preserving text edit — to a fixpoint, then re-lints:
132
+ `fixDocument` runs the linter and applies a `FixerRegistry` — fixers keyed by rule `code` that map a finding to a formatting-preserving text edit — to a fixpoint, then reports the findings that remain:
133
133
 
134
134
  ```ts
135
135
  import { fixDocument, type FixerRegistry } from '@amritk/lint'
@@ -161,7 +161,7 @@ const { output, applied } = await fixDocument(source, {
161
161
  })
162
162
  ```
163
163
 
164
- Fixing runs to a fixpoint, capped at 10 passes. The result reports how that ended: **`converged`** is `false` when the cap was hit while the document was still changing (usually two fixers undoing each other), and **`passes`** counts the passes that changed something. `applied` is de-duplicated by rule code and path, so a report can safely say "fixed N problems".
164
+ Fixing runs to a fixpoint, capped at 10 passes. `remaining` comes from the pass that found nothing left to fix, so a run that converges does not lint the fixed document a second time; only one that hits the cap does. The result reports how that ended: **`converged`** is `false` when the cap was hit while the document was still changing (usually two fixers undoing each other), and **`passes`** counts the passes that changed something. `applied` is de-duplicated by rule code and path, so a report can safely say "fixed N problems".
165
165
 
166
166
  ### Rendering findings
167
167
 
@@ -199,6 +199,7 @@ A ruleset is a plain object (authored as YAML, JSON, or a JS module):
199
199
  | `functions` / `functionsDir` | Custom functions to load by name (default dir `functions/`). |
200
200
  | `overrides` | Per-file-glob rule tweaks. |
201
201
  | `aliases` | Reusable `given` fragments referenced as `#alias`. |
202
+ | `parserOptions` | YAML parser strictness, each set to a severity. `duplicateKeys` reports a repeated key (default `error`; `off` allows it, and the last value wins). `incompatibleValues` is off by default and reports `.nan` / `.inf` / `-.inf`, which `JSON.stringify` silently turns into `null`. Parser findings carry the code `parser`. |
202
203
 
203
204
  Built-in functions: `alphabetical`, `casing`, `defined`, `enumeration`, `falsy`, `length`, `or`, `pattern`, `schema`, `truthy`, `undefined`, `unreferencedReusableObject`, `xor`, `typedEnum`.
204
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amritk/lint",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "A fast, format-agnostic JSON/YAML style-guide linter with JSON Schema and custom rules.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -69,7 +69,7 @@
69
69
  }
70
70
  },
71
71
  "dependencies": {
72
- "@amritk/runtime-validators": "^0.15.1",
72
+ "@amritk/runtime-validators": "^0.15.2",
73
73
  "@amritk/yaml": "^0.8.0",
74
74
  "jsonc-parser": "^3.3.1"
75
75
  },