@hailstails/hone 1.3.0 → 1.4.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/ADOPTING.md +2 -2
- package/CHANGELOG.md +22 -0
- package/MIGRATING.md +23 -0
- package/README.md +27 -6
- package/api/audit.d.ts +1 -1
- package/api/testing.js +3 -3
- package/chunks/chunk-335ITLPO.js +7 -0
- package/chunks/{chunk-YSN46EB3.js → chunk-6SM3HKWO.js} +270 -624
- package/chunks/{chunk-PL2PNPAR.js → chunk-E6VR3VRV.js} +1 -6
- package/chunks/{chunk-H4V72FCW.js → chunk-FEWCJU7H.js} +9 -1
- package/chunks/chunk-WF3PPYRR.js +27 -0
- package/core/check/tool-command.js +756 -64
- package/core/mechanism-port/runner-result-types.d.ts +6 -0
- package/docs/adding-a-discipline-or-mechanism.md +3 -3
- package/docs/extending.md +1 -0
- package/docs/output-contract.md +52 -10
- package/mechanisms/audit/CD-27/test-body-logic.js +394 -46
- package/mechanisms/audit/runner/runner.js +1 -1
- package/mechanisms/audit/runner/typescript-parse.d.ts +2 -0
- package/mechanisms/audit/runner/walker-piece.d.ts +2 -1
- package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +7 -4
- package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +21 -11
- package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +15 -5
- package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +7 -3
- package/mechanisms/eslint/CD-41/README.md +1 -1
- package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +100 -28
- package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +8 -4
- package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +8 -4
- package/mechanisms/eslint/runner/README.md +9 -2
- package/mechanisms/eslint/runner/runner.js +1404 -1382
- package/methods/lenses/di-discipline.md +4 -5
- package/methods/lenses/test-discipline.md +1 -1
- package/package.json +1 -1
- package/rules/CD-1/CHECKS.md +2 -0
- package/rules/CD-12/README.md +1 -1
- package/rules/CD-15/CHECKS.md +2 -0
- package/rules/CD-17/README.md +3 -3
- package/rules/CD-2/CHECKS.md +2 -0
- package/rules/CD-25/CHECKS.md +2 -2
- package/rules/CD-25/README.md +3 -3
- package/rules/CD-27/CHECKS.md +382 -6
- package/rules/CD-27/README.md +1 -1
- package/rules/CD-27/discipline.json +130 -0
- package/rules/CD-41/CHECKS.md +10 -0
- package/rules/CD-41/README.md +2 -0
- package/rules/CD-41/discipline.json +14 -0
- package/chunks/chunk-YLZ73C7O.js +0 -0
package/ADOPTING.md
CHANGED
|
@@ -337,7 +337,7 @@ CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
|
|
|
337
337
|
| `exempted` | findings an exception covers; informational |
|
|
338
338
|
| `unrecorded` | a native exception no record holds, as `<clause> <mechanism> <kind> <detail>`: remove it, or record it where step 7 allows. An inline disable, `<clause> eslint inline-disable <file>:<line> <comment>`, and a TypeScript directive, `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, are held only by an `authorised-location` or `file-carve-out` on that clause and file. An `eslint-disable` naming no rule escapes every selected clause, needs a record for each, and its lines end ` names no rule and escapes every selected clause: naming the rule is the cheap fix`. A lint-script option, `<clause> eslint command-line-option <package.json> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script`, cannot be recorded. Where another command comes before `eslint` in its script, as in `tsc && eslint -c eslint.config.mjs .`, the line instead reads `<clause> eslint command-line-option <package.json> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as "<invocation>"`: move that command to a script of its own. Where something before `eslint` in its own command is neither a package runner nor a `NAME=value` setting, as `env` in `env --chdir=src eslint --ignore-pattern dist .` or `-y` in `npx -y eslint --ignore-pattern dist .`, it reads `<clause> eslint command-line-option <package.json> <script> <option>: "<wrapper>" comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>`. `cross-env` followed only by `NAME=value` settings counts as a setting |
|
|
339
339
|
| `uncovered` | a mechanical clause of an adopted discipline is not listed: add it to `disciplines.json` with a mechanism, `"not-run"` or `"not-adopted"` |
|
|
340
|
-
| `stale` | an exception that no longer exempts anything:
|
|
340
|
+
| `stale` | an exception that no longer exempts anything. A `file-carve-out` whose file no longer exists is removed by the `hone prune-debt` command the last `readFirst` line names; run it, then `npm run --silent hone:project`. Delete every other stale record by hand, including a `file-carve-out` on a file that still exists, then run `hone:project` again ([README.md](README.md#pruning-paid-debt)). Right after a move from an older route, first check that its settings were carried over ([MIGRATING.md](MIGRATING.md#2a-carry-over-the-old-routes-settings) step 2a) |
|
|
341
341
|
| `forfeited` | a file carve-out whose file changed since `--base-revision`: fix the file and delete the carve-out |
|
|
342
342
|
| `invalidRecords` | an exception entry that cannot be accepted, with the reason, for example `clause-not-run` or `clause-not-adopted` for an entry on a clause listed as `"not-run"` or `"not-adopted"`: correct or delete it |
|
|
343
343
|
| `doublyHeld` | a file both authorised and carved out for one clause: keep one |
|
|
@@ -402,7 +402,7 @@ A repository with existing code usually has more findings than the change that a
|
|
|
402
402
|
|
|
403
403
|
The records are the same as any other `file-carve-out`: each is forfeited once its file changes, which is how the debt is paid down. A file with no earlier revision gets no record, because it has no debt to inherit. The command is for adoption, but it does not refuse to run again: forfeiture already stops it turning new findings into carve-outs, since a record written for a file just changed is forfeited by the next check that assesses decay. That holds only where decay is assessed. With `"assessment": { "forfeiture": "elsewhere" }` (step 5), it is assessed only by the run that the repository leaves it to, such as the pre-push hook, so a push that bypasses that run lets such a record through until a later run assesses it.
|
|
404
404
|
|
|
405
|
-
Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose
|
|
405
|
+
Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose debt is paid is reported `stale`, or `forfeited` with no finding left on its file. `hone prune-debt` removes it when its file no longer exists; otherwise delete it by hand ([README.md](README.md#pruning-paid-debt)).
|
|
406
406
|
|
|
407
407
|
## 8. Prove one failure and correction
|
|
408
408
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of Hone, newest first. `pnpm run release-pull-request` writes each new section from the commits merged to `main` since the previous release tag, whose subjects are the squash-merged pull request titles; README.md's Compatibility section says what each kind of release may change. The sections below were written by hand from the merged pull requests when the changelog started.
|
|
4
4
|
|
|
5
|
+
## 1.4.0
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- a CD-27 test-body-logic finding names the allowed form for what it flagged, and CHECKS.md shows each one, proven against every audit and ESLint clause Hone ships (#171)
|
|
10
|
+
- list paid ESLint debt as stale, and add hone prune-debt to remove the records of deleted files (#191)
|
|
11
|
+
|
|
12
|
+
### Fixes
|
|
13
|
+
|
|
14
|
+
- CD-41 function-length does not measure a test suite's describe body (#170)
|
|
15
|
+
- a CD-27 test-body-logic finding on JSON.stringify or JSON.parse points at CD-19 (#186)
|
|
16
|
+
|
|
17
|
+
### Other changes
|
|
18
|
+
|
|
19
|
+
- Hone's ESLint pieces observe sites through one boundary over ESLint's rule contract (#166)
|
|
20
|
+
- the ESLint runner reads lint messages and source lines through two units of their own (#177)
|
|
21
|
+
- CD-25 names stubs and spies with written-out answers as a unit test's doubles, and reads a double that needs behaviour as a finding (#180)
|
|
22
|
+
- hone check's measurement rules move from run-check into a unit of their own (#179)
|
|
23
|
+
- the ESLint runner reads its repository through readers named for what it asks, and its tests stub them (#181)
|
|
24
|
+
- CD-17, CD-27, CD-12 and the review lenses name a stub where they offered a fake clock or an in-memory fake (#188)
|
|
25
|
+
- hone check takes its selection through a repository, and its orchestration tests pass written-out objects (#183)
|
|
26
|
+
|
|
5
27
|
## 1.3.0
|
|
6
28
|
|
|
7
29
|
### Features
|
package/MIGRATING.md
CHANGED
|
@@ -351,3 +351,26 @@ Neither `"not-run"` nor `"not-adopted"` takes an exception record. Stop and ask
|
|
|
351
351
|
4. **Commit the removal and the new files in one change.** A tree that holds both `discipline-exceptions.json` and the folder fails every run with `records-in-both-layouts`. Point any code owners or review rules at the new files, such as `discipline-exceptions/file-carve-outs/cd-19.json`.
|
|
352
352
|
|
|
353
353
|
From then on, `hone record-debt` adds each record to its discipline's file, and a record a person writes goes in the file of its kind and discipline: one in any other file fails the load as `file-malformed`, naming the file it belongs in.
|
|
354
|
+
|
|
355
|
+
## 17. Pruning paid ESLint debt
|
|
356
|
+
|
|
357
|
+
Earlier releases never listed an `eslint` file record as `stale`. The off-switch `hone project` writes for a record counted as a `config-override` that the record held, so a record kept its rule off after its file stopped breaking the clause, and a new violation there went unreported. A forfeited `eslint` record's off-switch was also listed under `unrecorded` as a `config-override`. The check no longer counts the projection's own off-switches as native exceptions, and the new `hone prune-debt` removes the records of files that no longer exist.
|
|
358
|
+
|
|
359
|
+
1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check against the branch's base. If none of your `eslint` debt is paid, nothing changes.
|
|
360
|
+
2. **If some is, the run fails.** Each paid record is listed under `stale` as `<clause> eslint file-carve-out <file>`.
|
|
361
|
+
3. **Delete each of those records by hand** when its file still exists, then run `npm run --silent hone:project`, which prints `disciplines.eslint.mjs written`. A stale `authorised-location` or `clause-wide-carve-out` is left for a person in the same way.
|
|
362
|
+
4. **Run `hone prune-debt` for records whose file is gone.** When a stale or forfeited record names a file that no longer exists, the report ends with one `readFirst` line naming the command to run, such as:
|
|
363
|
+
|
|
364
|
+
```text
|
|
365
|
+
prune-debt: 3 file carve-outs under stale or forfeited still record debt that is paid; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove what is paid, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit the exception records with every disciplines.eslint.mjs it writes
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
From the repository root that is:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
node_modules/.bin/hone prune-debt --repo . --base-revision origin/main
|
|
372
|
+
npm run --silent hone:project
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
`hone prune-debt` prints `<clause> removed <file>` for each record it removed. Commit the exception records and `disciplines.eslint.mjs`, and each package slice `hone project` writes. The check passes.
|
|
376
|
+
5. **Look for a team override that surfaces.** An off-switch your own config places after the projection, for a rule and file a removed record held, was hidden behind the record. It is now listed under `unrecorded` as a `config-override`; [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with it.
|
package/README.md
CHANGED
|
@@ -25,24 +25,25 @@ A team adds its own disciplines as a rule set in its own repository, with ESLint
|
|
|
25
25
|
|
|
26
26
|
## Commands
|
|
27
27
|
|
|
28
|
-
The package ships one command, `hone`, with
|
|
28
|
+
The package ships one command, `hone`, with five subcommands. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of files that no longer exist; `split-records` runs once, when a repository moves its records to [the split layout](#the-split-layout):
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
31
|
hone check --repo <dir> [--base-revision <revision>] [--report-output <full|failures-only|counts|verdict-only>] [--forfeiture <this-run|elsewhere>]
|
|
32
32
|
hone project --repo <dir>
|
|
33
33
|
hone record-debt --repo <dir> --base-revision <revision> [--leave <path>]...
|
|
34
|
+
hone prune-debt --repo <dir> [--base-revision <revision>] [--forfeiture <this-run|elsewhere>]
|
|
34
35
|
hone split-records --repo <dir>
|
|
35
36
|
hone --help
|
|
36
37
|
hone --version
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
`--repo` is the folder that holds `disciplines.json`, usually the repository root. `hone --help` lists the commands, `hone check --help`, `hone project --help`, `hone record-debt --help` and `hone split-records --help` list each one's options and exit codes, and `hone --version` prints the installed version. A command typed wrongly is a load failure `arguments-invalid` that says what was wrong, a `--repo` folder with no `disciplines.json` is the load failure `selection-absent`, and an error Hone did not expect is the load failure `unexpected-error`; each exits `2`. Everything Hone prints goes to standard output, so exit `1` always comes with `verdict: fail`. From a source checkout the same command is `node core/check/tool-command.ts check --repo <dir>`.
|
|
40
|
+
`--repo` is the folder that holds `disciplines.json`, usually the repository root. `hone --help` lists the commands, `hone check --help`, `hone project --help`, `hone record-debt --help`, `hone prune-debt --help` and `hone split-records --help` list each one's options and exit codes, and `hone --version` prints the installed version. A command typed wrongly is a load failure `arguments-invalid` that says what was wrong, a `--repo` folder with no `disciplines.json` is the load failure `selection-absent`, and an error Hone did not expect is the load failure `unexpected-error`; each exits `2`. Everything Hone prints goes to standard output, so exit `1` always comes with `verdict: fail`. From a source checkout the same command is `node core/check/tool-command.ts check --repo <dir>`.
|
|
40
41
|
|
|
41
42
|
[docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, exactly as it prints it, with the exit codes and which parts are stable for hooks, CI and agents to rely on. A test renders every kind of line and checks it against that page, both ways.
|
|
42
43
|
|
|
43
|
-
`hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; and prints a plain-text report ending in `verdict: pass` or `verdict: fail`, followed by ` (partial assessment)` when the run left part of the assessment to another run. It exits `0` when the verdict is `pass`, `1` when it is `fail`, and `2` on a load failure, which prints one line, `load failure: <kind> <fields>`. `hone project`, `hone record-debt` and `hone split-records` exit `0` or `2`.
|
|
44
|
+
`hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; and prints a plain-text report ending in `verdict: pass` or `verdict: fail`, followed by ` (partial assessment)` when the run left part of the assessment to another run. It exits `0` when the verdict is `pass`, `1` when it is `fail`, and `2` on a load failure, which prints one line, `load failure: <kind> <fields>`. `hone project`, `hone record-debt`, `hone prune-debt` and `hone split-records` exit `0` or `2`.
|
|
44
45
|
|
|
45
|
-
The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
|
|
46
|
+
The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings and the command that removes the records of files that no longer exist, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
|
|
46
47
|
|
|
47
48
|
An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end with a note:
|
|
48
49
|
|
|
@@ -58,7 +59,7 @@ An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end wi
|
|
|
58
59
|
|
|
59
60
|
`readFirst` comes last, just before the verdict, so a reader who looks only at the end of a failing report lands on it. It has one line per clause with findings, not one per finding, in the order the findings first name the clauses. Each line points at the Spirit section of the clause's rule page, `rules/<ID>/README.md` in the clause's rule set, and, where the repository has written one, at the clause's own section in `disciplines.assessment.md` at the repository root first. That file is where a repository records its own causes, forward goal and steps for a clause; [ADOPTING step 5a](ADOPTING.md#5a-write-the-assessment) says how to write it. Paths are printed with forward slashes, relative to the `--repo` folder; a page on another drive is printed as its absolute path.
|
|
60
61
|
|
|
61
|
-
When `disciplines.assessment.md` is not written yet, or cannot be read, one note line comes first and says so, naming ADOPTING step 5a; each clause line then names its rule page only. The note counts as an entry, so a report with two failing clauses and no assessment file prints `readFirst (3)`. A clause line names the clause's section when the file has one, and says `disciplines.assessment.md does not assess this clause` when the file is there without it. [The output contract](docs/output-contract.md#report-lines) lists every `readFirst` line exactly.
|
|
62
|
+
When `disciplines.assessment.md` is not written yet, or cannot be read, one note line comes first and says so, naming ADOPTING step 5a; each clause line then names its rule page only. The note counts as an entry, so a report with two failing clauses and no assessment file prints `readFirst (3)`. A clause line names the clause's section when the file has one, and says `disciplines.assessment.md does not assess this clause` when the file is there without it. When the check finds a `stale` or `forfeited` `file-carve-out` on a file that no longer exists, one more line comes last and names the exact `hone prune-debt` command for this repository, as [Pruning paid debt](#pruning-paid-debt) shows. [The output contract](docs/output-contract.md#report-lines) lists every `readFirst` line exactly.
|
|
62
63
|
|
|
63
64
|
A file that does not assess a clause is normal: the assessment covers the clauses the repository chose to describe, and the rule page's Spirit is the read for the rest.
|
|
64
65
|
|
|
@@ -116,10 +117,30 @@ It never writes anything wider than one clause in one file: no `authorised-locat
|
|
|
116
117
|
|
|
117
118
|
Other native exceptions under `unrecorded`, such as a `config-override` or a lint-script option, are not recorded: [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with each.
|
|
118
119
|
|
|
119
|
-
It adds the new entries after the last one and leaves every entry already in the file as written. It stages and commits nothing: the diff of the exception records is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again adds records only for pairs that still have none. A record
|
|
120
|
+
It adds the new entries after the last one and leaves every entry already in the file as written. It stages and commits nothing: the diff of the exception records is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again adds records only for pairs that still have none. A record on a file that no longer exists is removed by `hone prune-debt`, below. Run `hone project` after it when any clause is `eslint`, so the projection carries the new records.
|
|
120
121
|
|
|
121
122
|
The command does not refuse to run again later, and has no flag for it. Forfeiture is what stops it turning new findings into carve-outs: a file carve-out is forfeited once its file changes since `--base-revision`, so a record written for a file someone has just changed fails the next check that assesses forfeiture, and a file that is new since the base gets no record at all. That holds only where forfeiture is assessed. In an arrangement that leaves it elsewhere, such as `"assessment": { "forfeiture": "elsewhere" }` with the pre-push hook that assesses it bypassed, such a record is not caught until a run that does assess it.
|
|
122
123
|
|
|
124
|
+
### Pruning paid debt
|
|
125
|
+
|
|
126
|
+
A `file-carve-out` is debt, and once the debt is paid the record should go. `hone prune-debt` removes the records whose file no longer exists: each `file-carve-out` under `stale` or `forfeited` whose file is gone from the repository, unless the report still lists a finding or a native exception on its clause and file.
|
|
127
|
+
|
|
128
|
+
Every other record stays for a person:
|
|
129
|
+
|
|
130
|
+
- **A `stale` `file-carve-out` on a file that still exists:** the command does not remove it. Delete it by hand, then run `hone project` when its clause is `eslint`.
|
|
131
|
+
- **A `forfeited` record on a file that still exists:** fix the file and delete the record, as for any forfeited record. While the file still breaks its clause, the record keeps failing the run.
|
|
132
|
+
- **An `authorised-location` or `clause-wide-carve-out` under `stale`:** it carries a person's judgement, so delete it by hand.
|
|
133
|
+
|
|
134
|
+
The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given. A check that finds a `file-carve-out` on a file that no longer exists names the command exactly in its last `readFirst` line, just above the verdict, with `hone project` after it when any of the records is for an `eslint` clause:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
prune-debt: 3 file carve-outs under stale or forfeited still record debt that is paid; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove what is paid, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit the exception records with every disciplines.eslint.mjs it writes
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
It prints `<clause> removed <file>` for each record it removed, ordered by file and then by clause, and nothing when it removed none. Like `hone record-debt`, it writes the exception records in whichever layout the repository keeps them, keeps every other record's text byte for byte, stages and commits nothing, and does not write the projection: run `hone project` after it when any clause is `eslint`, so the projection drops the records' off-switches. When it removes the last record from a file, it follows the layout: in [the split layout](#the-split-layout) it deletes that rule's file, as `hone split-records` writes a file only for a rule that holds records; a single `discipline-exceptions.json` is left holding an empty list. It has no dry run, as no other Hone command has: the `stale` and `forfeited` lines naming a file that no longer exists name what it removes, and the diff of the records is the review.
|
|
141
|
+
|
|
142
|
+
For an `eslint` clause, the off-switch the projection writes for a record is Hone's own. The check does not list it as a `config-override`, so it never counts as a native exception the record holds, and a record whose file no longer breaks its clause is `stale` like any other. A `config-override` on a clause and file no record holds is reported as before. While a record holds a file, the team's own off-switch for that rule and file cannot be told from the projection's, and the record holds the file either way. Once the record is removed, a team off-switch placed after the projection is listed under `unrecorded` as a `config-override`, and one placed before it never takes effect, since the projection turns the rule on after it, so ESLint and the check both flag the file. A team block placed after the projection that sets a recorded file's rule to `"warn"` or `"error"` leaves the projection out of effect, and the check says `not-included`, as before.
|
|
143
|
+
|
|
123
144
|
## Adopting the ESLint mechanism
|
|
124
145
|
|
|
125
146
|
With any clause selected for `eslint`, run `hone project`. It writes `disciplines.eslint.mjs` at the repository root: one block per piece enabling its selected rules at `"error"` on `**/*.{ts,tsx,mts,cts}`, then one block per set of clauses that files are excepted from, listing those files and turning the rules `"off"` for them, and one block per clause-wide carve-out turning its rules `"off"` everywhere. Commit it, and spread its default export last in the repository's flat config:
|
package/api/audit.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { PieceFailure } from "../core/mechanism-port/piece-failure-types.js
|
|
|
2
2
|
export type { ClauseSettingValues, RunnerClause } from "../core/mechanism-port/runner-module-types.js";
|
|
3
3
|
export type { ReadonlyJsonValue } from "../core/values/json-value.js";
|
|
4
4
|
export type { Edition, EditionReach } from "../core/values/edition-types.js";
|
|
5
|
-
export type { Hit } from "../core/mechanism-port/runner-result-types.js";
|
|
5
|
+
export type { Hit, Remedy } from "../core/mechanism-port/runner-result-types.js";
|
|
6
6
|
export type { Anchor, AnchorKind } from "../core/values/anchor.js";
|
|
7
7
|
export type { ClauseAddress, ToolRuleSet } from "../core/values/clause-address-types.js";
|
|
8
8
|
export type { ClauseId, DisciplineId, RuleSetName } from "../core/values/identifier-types.js";
|
package/api/testing.js
CHANGED
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
loadRunner,
|
|
6
6
|
rejectedCall,
|
|
7
7
|
runnerInvalidOutput
|
|
8
|
-
} from "../chunks/chunk-
|
|
8
|
+
} from "../chunks/chunk-6SM3HKWO.js";
|
|
9
9
|
import {
|
|
10
10
|
caseVerdictSchema,
|
|
11
11
|
runnerResultSchema
|
|
12
|
-
} from "../chunks/chunk-
|
|
12
|
+
} from "../chunks/chunk-FEWCJU7H.js";
|
|
13
13
|
import {
|
|
14
14
|
readDisciplineFile,
|
|
15
15
|
readPieceFile
|
|
16
|
-
} from "../chunks/chunk-
|
|
16
|
+
} from "../chunks/chunk-E6VR3VRV.js";
|
|
17
17
|
import "../chunks/chunk-RWQ4UNKY.js";
|
|
18
18
|
import "../chunks/chunk-NA5L6PUE.js";
|
|
19
19
|
import {
|