@konvert7/klint 1.7.0 → 1.8.0

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.
package/README.md CHANGED
@@ -131,10 +131,35 @@ klint install-skill [--agents <list>] [--symlink | --copy] [--force]
131
131
  | `--config <dir>` | Directory containing `klint.yaml` or `klint.config.json` (default: cwd) |
132
132
  | `--fix` | Apply auto-fixes for fixable violations in-place |
133
133
  | `--json` | Emit structured JSON to stdout for agents and CI |
134
- | `--hook` | Count this run as an agent hook run in `klint stats` |
134
+ | `--hook` | Count this run as an agent hook run in `klint stats`, and keep the plain text format described below |
135
135
  | `migrate` | Rewrite a v1 config to the v2 rule groups in place, keeping comments and blank lines |
136
136
  | `migrate --check` | Exit 1 when the config is v1 and 0 when it is v2; never writes |
137
137
 
138
+ ### Text output
139
+
140
+ Without `--json`, klint writes a report to stderr in the style of Biome:
141
+
142
+ ```text
143
+ klint: 1 error(s)
144
+
145
+ src/a.ts:1:11 [no-string-match] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146
+
147
+ × Use RegExp.exec() instead of String.match() for non-global regexes — use /x/.exec(s) instead.
148
+
149
+ > 1 │ const m = s.match(/x/);
150
+ │ ^^^^^^^^^^^^
151
+
152
+ klint: 1 violation(s) can be fixed automatically: run `klint --fix`.
153
+
154
+ klint: finished in 8ms
155
+ ```
156
+
157
+ - On a terminal, errors are red, warnings yellow, and file paths and hints dimmed.
158
+ - When a rule knows where the offending code starts, the header ends in `line:column` and the source line is printed with the span underlined by carets. Rules that only know the line (the architecture rules, cognitive complexity, function length, blank lines and a few others) print the header and message alone.
159
+ - Colour is off when `NO_COLOR` is set to a non-empty value or stderr is not a terminal (pipes, CI logs, redirected files). The column and carets stay.
160
+ - `--hook` keeps the text format of klint 1.7 byte for byte: no colour, no column, no carets.
161
+ - `--json` never includes the column; its output is unchanged.
162
+
138
163
  `klint install-skill` installs the bundled rule-authoring skill for agent environments:
139
164
 
140
165
  ```sh
@@ -261,7 +286,7 @@ arch:
261
286
 
262
287
  The rule ids in the output stay `sonar/…`, for example `sonar/prefer-at`.
263
288
 
264
- **v1 still works.** The flat map under `rules` (with `sonar/` prefixes) and `plugins: [sonar]` are still read. A v1 config gets one `klint/config` warning. `klint migrate` or `klint --fix` upgrades it in place and keeps comments, blank lines and key order. It refuses, naming the line, when it cannot do that safely: YAML anchors, aliases, tags, a flow-map `rules`, duplicate keys, or a config that mixes v1 and v2 keys. A mixed config is read as v2 and the v1 entries are ignored, with one warning.
289
+ **v1 still works.** The flat map under `rules` (with `sonar/` prefixes) and `plugins: [sonar]` are still read. A v1 config gets one `klint/config` warning. `klint migrate` or `klint --fix` upgrades it in place and keeps comments, blank lines and key order. It refuses, naming the line, when it cannot do that safely: YAML anchors, aliases, tags, a flow-map `rules`, duplicate keys, or a config that mixes v1 and v2 keys. A mixed config is read as v2 and the v1 entries are ignored, with one warning. `no-date-equality` and `no-floating-promise` move to `rules.experimental`. A v1 config ignores them, so after the migration they run for the first time; `klint migrate` prints how many findings each one has.
265
290
 
266
291
  `arch` declares architecture constraints without writing a custom rule.
267
292
 
package/klint.schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.7.0/klint.schema.json",
2
+ "$id": "https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.8.0/klint.schema.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "additionalProperties": false,
5
5
  "description": "klint configuration. Lives at klint.yaml (or klint.config.json) next to biome.json and knip.json.",
package/klint.schema.yaml CHANGED
@@ -1,4 +1,4 @@
1
- $id: https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.7.0/klint.schema.json
1
+ $id: https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.8.0/klint.schema.json
2
2
  $schema: http://json-schema.org/draft-07/schema#
3
3
  additionalProperties: false
4
4
  description: klint configuration. Lives at klint.yaml (or klint.config.json) next to biome.json and knip.json.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konvert7/klint",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Architecture-as-Code linter for TypeScript. Enforce layer boundaries, import rules, and singleton patterns in YAML.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -65,12 +65,12 @@
65
65
  ]
66
66
  },
67
67
  "optionalDependencies": {
68
- "@konvert7/klint-darwin-arm64": "1.7.0",
69
- "@konvert7/klint-darwin-x64": "1.7.0",
70
- "@konvert7/klint-linux-arm64": "1.7.0",
71
- "@konvert7/klint-linux-x64": "1.7.0",
72
- "@konvert7/klint-linux-x64-musl": "1.7.0",
73
- "@konvert7/klint-win32-x64": "1.7.0"
68
+ "@konvert7/klint-darwin-arm64": "1.8.0",
69
+ "@konvert7/klint-darwin-x64": "1.8.0",
70
+ "@konvert7/klint-linux-arm64": "1.8.0",
71
+ "@konvert7/klint-linux-x64": "1.8.0",
72
+ "@konvert7/klint-linux-x64-musl": "1.8.0",
73
+ "@konvert7/klint-win32-x64": "1.8.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@biomejs/biome": "2.6.5",