3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Hold the import boundaries in the lint config and name its script and leg lint

This commit is contained in:
2026-10-22 01:36:09 +02:00
committed by Lillem4n
parent 9d180ae7e8
commit c2fa6fa9b0
5 changed files with 30 additions and 27 deletions
+14
View File
@@ -2,6 +2,20 @@
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": { "correctness": "off" },
"ignorePatterns": ["src/**/*.test.ts", "src/conformance/property-harness.ts"],
"overrides": [
{
"files": ["src/markdown/directive/**"],
"rules": {
"no-restricted-imports": ["error", { "patterns": [{ "group": ["**/emit/**", "**/parse/**"], "message": "docs/decisions.md §The source parts by ADF and format" }] }]
}
},
{
"files": ["src/markdown/parse/**"],
"rules": {
"no-restricted-imports": ["error", { "patterns": [{ "group": ["**/emit/**", "!../emit/spelling-questions.ts"], "message": "docs/decisions.md §The source parts by ADF and format" }] }]
}
}
],
"rules": {
"eslint/max-lines-per-function": ["error", { "IIFEs": true, "max": 52, "skipBlankLines": false, "skipComments": false }]
}
+1 -1
View File
@@ -5,7 +5,7 @@ source ./docker-runner.sh
leg "install ($node_image)" in_image "$node_image" npm ci
leg "typecheck ($node_image)" in_image "$node_image" npm run typecheck
leg "size ratchet ($node_image)" in_image "$node_image" npm run size-ratchet
leg "lint ($node_image)" in_image "$node_image" npm run lint
test_log=$(mktemp)
node_tests() {
+10 -5
View File
@@ -672,13 +672,14 @@ compared against `undefined` — have a half no valid document reaches.
## The size ratchet
2026-09-20, the maintainer. KISS, a technical principle. Valid while no measure picks out what
readers find hard better than a function's length.
2026-09-20, the import boundaries 2026-10-22, the maintainer. KISS, a technical principle. Valid
while no measure picks out what readers find hard better than a function's length.
`.oxlintrc.json`'s single rule, over the files `tsconfig.build.json` builds, is a per-function line
`.oxlintrc.json` holds one size rule and the import boundaries of §The source parts by ADF and
format. The size rule, over the files `tsconfig.build.json` builds, is a per-function line
ceiling, set at that set's worst and moving only downward. It covers the built files alone, since
one ceiling over the tests too would have to be their worst, loosening the guard over the shipped
code. It guards against drift and never drives a refactor, so no cyclomatic rule and no second lint
code. It guards against drift and never drives a refactor, so no cyclomatic rule and no second size
rule join it: neither measure picked out what nine readers found hard (the comprehension panel,
2026-09-20). `oxlint` measures it since TypeScript 7 is a native compiler publishing no in-process
parser, only the `unstable/` AST surface an out-of-process handshake reaches. Three switches guard
@@ -687,6 +688,9 @@ config gone missing fails the leg instead of falling back to oxlint's own defaul
`--deny-warnings`, since a rule from a category this config never names arrives as a warning it
exits 0 on.
The boundaries are `no-restricted-imports` overrides over the same files, since the technical
principles refuse a test that scans the source and a regex misses import spellings a rule reads.
## The project ships under the comprehension floor until items 62 and 95 land
2026-10-03, the maintainer; item 95 in place of item 61, 2026-10-09, the maintainer. KISS, a
@@ -935,4 +939,5 @@ whether a list marker interrupts a paragraph — is one function there too, neve
direction, however conservative the copy would be. Where the rule is the emitter's own choice, input
consults it rather than restating it, so no fixture the emitter writes can be refused, and a
spelling the emitter refuses gives its own error rather than a second name for it. That consulting
is the only import `parse/` takes from `emit/`, through `emit/spelling-questions.ts`.
is the only import `parse/` takes from `emit/`, through `emit/spelling-questions.ts`. `.oxlintrc.json` holds that import, and keeps
`markdown/directive/` from importing `emit/` or `parse/` (§The size ratchet).
+1 -1
View File
@@ -41,7 +41,7 @@
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"size-ratchet": "oxlint --deny-warnings -c .oxlintrc.json src",
"lint": "oxlint --deny-warnings -c .oxlintrc.json src",
"test": "node --test --experimental-test-coverage --test-coverage-exclude=\"src/**/*.test.ts\" --test-coverage-exclude=src/conformance/property-harness.ts --test-coverage-branches=98 --test-coverage-functions=100 --test-coverage-lines=100 \"src/**/*.test.ts\"",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.build.json"
},
+4 -20
View File
@@ -12,7 +12,6 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 126 | 0.3.0 | | question | **Decide whether `.oxlintrc.json` may hold the import boundaries, and hold them there.** | 1 | 2 | 1 | 2 | 2 | code health by 2 | 17.4 |
| 92 | 0.3.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 1 | 1 | 2 | 4 | code health by 4 | 17.4 |
| 102 | 0.3.0 | | decision | **Place a block a portable task list refuses at its path in the returned document without replaying `splitTaskList` on stand-in nodes.** | 2 | 1 | 2 | 3 | 4 | code health by 4 | 17.4 |
| 62 | 0.3.0 | | decision | **Move the portable flavour's reading out of `parse/` and its writing out of `emit/` into `markdown/portable/`, so `emit/` no longer imports `portable/`.** | 3 | 1 | 2 | 4 | 5 | code health by 5 | 13.1 |
@@ -24,7 +23,7 @@
| 109 | 0.3.0 | | defect | **Spell nested lists and quotes in time linear in the markdown.** | 3 | 1 | 2 | 4 | 5 | 9 by 3 | 7.8 |
| 115 | 0.3.0 | | defect | **Build text holding no `border` mark in `losslessMarkdownToAdf`, and have `adfToLosslessMarkdown` carry text holding one.** | 2 | 1 | 2 | 3 | 3 | 4 by 3 | 4.6 |
| 91 | 0.3.0 | 95 | | **Spell an emphasis once across the code spans, an emphasis or link once across the hard breaks, dates, emoji, inline cards, mentions and statuses between two nodes it marks, and an emphasis across inline media, in both writers.** | 3 | 2 | 2 | 5 | 5 | 6 by 6 | 3.6 |
| 73 | 0.3.0 | 33, 62, 91, 92, 95, 102, 109, 115, 122, 123, 125, 126 | | **Announce the package where someone needing an ADF converter already reads: JRACLOUD-77436, the Atlassian developer community and Stack Overflow's ADF-to-markdown questions.** | 1 | 2 | 2 | 3 | 2 | 3 by 8 | 16.9 |
| 73 | 0.3.0 | 33, 62, 91, 92, 95, 102, 109, 115, 122, 123, 125 | | **Announce the package where someone needing an ADF converter already reads: JRACLOUD-77436, the Atlassian developer community and Stack Overflow's ADF-to-markdown questions.** | 1 | 2 | 2 | 3 | 2 | 3 by 8 | 16.9 |
| 75 | 0.4.0 | | | **Make the generated-markdown property write block carries as `adf:` fences, canonical and hostile.** | 1 | 1 | 1 | 1 | 2 | code health by 2 | 17.4 |
| 45 | 0.4.0 | | defect | **Replace `isAdfDocument` with a reader returning `Result<AdfDocument>`.** | 2 | 1 | 3 | 4 | 3 | 1 by 2 | 13.1 |
| 68 | 0.4.0 | | defect | **Carry a non-text inline node holding `content` or `text`, a block holding `text`, and a leaf block holding `content`.** | 2 | 1 | 2 | 3 | 3 | 1 by 2 | 13.1 |
@@ -59,22 +58,6 @@
## Details
### 126. Decide whether `.oxlintrc.json` may hold the import boundaries, and hold them there.
Two boundaries in `docs/decisions.md` §The source parts by ADF and format hold by convention only:
`src/markdown/parse/` imports from `src/markdown/emit/` only `emit/spelling-questions.ts`, and
`src/markdown/directive/` imports neither `emit/` nor `parse/`. The technical principles refuse a
test that scans the source: principle "Assert the outcome" bans it. oxlint 1.89.0 can hold both
boundaries with `overrides` carrying `no-restricted-imports`. Verified: a forbidden import fails
the `size-ratchet` leg in each form, as `from '…'`, as a bare `import '…'`, with a double-quoted
specifier and as a dynamic `import()`. An import of `../emit/spelling-questions.ts`, listed as the
exception, passes.
But the maintainer's §The size ratchet gives `.oxlintrc.json` a single rule and says no second
lint rule joins it. The question for the maintainer: may the config hold a second kind of rule, the
import boundaries? If so, amend that entry's "single rule" and "no second lint rule", and rename the
`size-ratchet` script and `ci.sh` leg, whose name would no longer say what they hold.
### 92. Lower the reading cost of the files a chunk reads most before its first commit.
The last five chunks' median is 106412 new input tokens before their first commit, the five before
@@ -221,8 +204,9 @@ Three tests read source text:
production cause and every call site names a declared code. A code held in a variable or passed
through another helper escapes it.
Item 81 changes `result.test.ts` too. Whether `.oxlintrc.json` may hold a lint rule for the
`JSON.parse` ban is item 126's question. Found by the technical-principles audit of item 60,
Item 81 changes `result.test.ts` too. `docs/decisions.md` §The size ratchet now lets
`.oxlintrc.json` hold rules beyond the size ceiling, so the `JSON.parse` ban can become a lint
rule. Found by the technical-principles audit of item 60,
2026-10-22.
### 112. Pad a GFM pipe table's short rows with empty cells, read its body rows holding no pipe, and read a one-column table without leading pipes in `portableMarkdownToAdf`.